Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
helm3
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
helm3
Commits
4573939f
Commit
4573939f
authored
Mar 29, 2016
by
jackgr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update expander test repo provider
parent
c391fc17
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
7 deletions
+26
-7
expander_test.go
cmd/manager/manager/expander_test.go
+26
-7
No files found.
cmd/manager/manager/expander_test.go
View file @
4573939f
...
...
@@ -35,12 +35,16 @@ import (
)
var
(
TestRepoBucket
=
"kubernetes-charts-testing"
TestRepoURL
=
"gs://"
+
TestRepoBucket
TestChartName
=
"frobnitz"
TestChartVersion
=
"0.0.1"
TestArchiveName
=
TestChartName
+
"-"
+
TestChartVersion
+
".tgz"
TestResourceType
=
TestRepoURL
+
"/"
+
TestArchiveName
TestRepoBucket
=
"kubernetes-charts-testing"
TestRepoURL
=
"gs://"
+
TestRepoBucket
TestChartName
=
"frobnitz"
TestChartVersion
=
"0.0.1"
TestArchiveName
=
TestChartName
+
"-"
+
TestChartVersion
+
".tgz"
TestResourceType
=
TestRepoURL
+
"/"
+
TestArchiveName
TestRepoType
=
string
(
repo
.
GCSRepoType
)
TestRepoFormat
=
string
(
repo
.
GCSRepoFormat
)
TestRepoCredentialName
=
"default"
TestRepoName
=
TestRepoBucket
)
var
validResponseTestCaseData
=
[]
byte
(
`
...
...
@@ -262,7 +266,7 @@ func TestExpandTemplate(t *testing.T) {
ts
:=
httptest
.
NewServer
(
http
.
HandlerFunc
(
etc
.
Handler
))
defer
ts
.
Close
()
expander
:=
NewExpander
(
ts
.
URL
,
nil
)
expander
:=
NewExpander
(
ts
.
URL
,
getTestRepoProvider
(
t
)
)
resource
:=
&
common
.
Resource
{
Name
:
"test_invocation"
,
Type
:
TestResourceType
,
...
...
@@ -368,3 +372,18 @@ func expanderSuccessHandler(w http.ResponseWriter, r *http.Request) {
svcResp
:=
getValidServiceResponse
()
util
.
LogHandlerExitWithJSON
(
handler
,
w
,
svcResp
,
http
.
StatusOK
)
}
func
getTestRepoProvider
(
t
*
testing
.
T
)
repo
.
IRepoProvider
{
rs
:=
repo
.
NewInmemRepoService
()
rp
:=
repo
.
NewRepoProvider
(
rs
,
nil
,
nil
)
tr
,
err
:=
repo
.
NewRepo
(
TestRepoURL
,
TestRepoCredentialName
,
TestRepoName
,
TestRepoFormat
,
TestRepoType
)
if
err
!=
nil
{
t
.
Fatalf
(
"cannot create test repository: %s"
,
err
)
}
if
err
:=
rs
.
CreateRepo
(
tr
);
err
!=
nil
{
t
.
Fatalf
(
"cannot initialize repository service: %s"
,
err
)
}
return
rp
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment