Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
cb123dc9
Commit
cb123dc9
authored
Jun 03, 2015
by
Chao Xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
in api/testapi/testapt_test.go, remove tests for v1beta1, add tests for v1
parent
97b29c7f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
22 deletions
+22
-22
testapi_test.go
pkg/api/testapi/testapi_test.go
+22
-22
No files found.
pkg/api/testapi/testapi_test.go
View file @
cb123dc9
...
@@ -46,9 +46,9 @@ func TestResourcePathWithPrefixForV1Beta3(t *testing.T) {
...
@@ -46,9 +46,9 @@ func TestResourcePathWithPrefixForV1Beta3(t *testing.T) {
}
}
}
}
func
TestResourcePathWithPrefixForV1
Beta1
(
t
*
testing
.
T
)
{
func
TestResourcePathWithPrefixForV1
(
t
*
testing
.
T
)
{
if
Version
()
!=
"v1
beta1
"
{
if
Version
()
!=
"v1"
{
// Skip the test if we are not testing v1
beta1
.
// Skip the test if we are not testing v1.
return
return
}
}
...
@@ -59,11 +59,11 @@ func TestResourcePathWithPrefixForV1Beta1(t *testing.T) {
...
@@ -59,11 +59,11 @@ func TestResourcePathWithPrefixForV1Beta1(t *testing.T) {
name
string
name
string
expected
string
expected
string
}{
}{
{
"prefix"
,
"resource"
,
"mynamespace"
,
"myresource"
,
"/api/v1
beta1/prefix
/resource/myresource"
},
{
"prefix"
,
"resource"
,
"mynamespace"
,
"myresource"
,
"/api/v1
/prefix/namespaces/mynamespace
/resource/myresource"
},
{
"prefix"
,
"resource"
,
""
,
"myresource"
,
"/api/v1
beta1
/prefix/resource/myresource"
},
{
"prefix"
,
"resource"
,
""
,
"myresource"
,
"/api/v1/prefix/resource/myresource"
},
{
"prefix"
,
"resource"
,
"mynamespace"
,
""
,
"/api/v1
beta1/prefix
/resource"
},
{
"prefix"
,
"resource"
,
"mynamespace"
,
""
,
"/api/v1
/prefix/namespaces/mynamespace
/resource"
},
{
"prefix"
,
"resource"
,
""
,
""
,
"/api/v1
beta1
/prefix/resource"
},
{
"prefix"
,
"resource"
,
""
,
""
,
"/api/v1/prefix/resource"
},
{
""
,
"resource"
,
"mynamespace"
,
"myresource"
,
"/api/v1
beta1
/resource/myresource"
},
{
""
,
"resource"
,
"mynamespace"
,
"myresource"
,
"/api/v1
/namespaces/mynamespace
/resource/myresource"
},
}
}
for
_
,
item
:=
range
testCases
{
for
_
,
item
:=
range
testCases
{
if
actual
:=
ResourcePathWithPrefix
(
item
.
prefix
,
item
.
resource
,
item
.
namespace
,
item
.
name
);
actual
!=
item
.
expected
{
if
actual
:=
ResourcePathWithPrefix
(
item
.
prefix
,
item
.
resource
,
item
.
namespace
,
item
.
name
);
actual
!=
item
.
expected
{
...
@@ -96,9 +96,9 @@ func TestResourcePathForV1Beta3(t *testing.T) {
...
@@ -96,9 +96,9 @@ func TestResourcePathForV1Beta3(t *testing.T) {
}
}
}
}
func
TestResourcePathForV1
Beta1
(
t
*
testing
.
T
)
{
func
TestResourcePathForV1
(
t
*
testing
.
T
)
{
if
Version
()
!=
"v1
beta1
"
{
if
Version
()
!=
"v1"
{
// Skip the test if we are not testing v1
beta1
.
// Skip the test if we are not testing v1.
return
return
}
}
...
@@ -108,10 +108,10 @@ func TestResourcePathForV1Beta1(t *testing.T) {
...
@@ -108,10 +108,10 @@ func TestResourcePathForV1Beta1(t *testing.T) {
name
string
name
string
expected
string
expected
string
}{
}{
{
"resource"
,
"mynamespace"
,
"myresource"
,
"/api/v1
beta1
/resource/myresource"
},
{
"resource"
,
"mynamespace"
,
"myresource"
,
"/api/v1
/namespaces/mynamespace
/resource/myresource"
},
{
"resource"
,
""
,
"myresource"
,
"/api/v1
beta1
/resource/myresource"
},
{
"resource"
,
""
,
"myresource"
,
"/api/v1/resource/myresource"
},
{
"resource"
,
"mynamespace"
,
""
,
"/api/v1
beta1
/resource"
},
{
"resource"
,
"mynamespace"
,
""
,
"/api/v1
/namespaces/mynamespace
/resource"
},
{
"resource"
,
""
,
""
,
"/api/v1
beta1
/resource"
},
{
"resource"
,
""
,
""
,
"/api/v1/resource"
},
}
}
for
_
,
item
:=
range
testCases
{
for
_
,
item
:=
range
testCases
{
if
actual
:=
ResourcePath
(
item
.
resource
,
item
.
namespace
,
item
.
name
);
actual
!=
item
.
expected
{
if
actual
:=
ResourcePath
(
item
.
resource
,
item
.
namespace
,
item
.
name
);
actual
!=
item
.
expected
{
...
@@ -144,9 +144,9 @@ func TestResourcePathWithNamespaceQueryForV1Beta3(t *testing.T) {
...
@@ -144,9 +144,9 @@ func TestResourcePathWithNamespaceQueryForV1Beta3(t *testing.T) {
}
}
}
}
func
TestResourcePathWithNamespaceQueryForV1
Beta1
(
t
*
testing
.
T
)
{
func
TestResourcePathWithNamespaceQueryForV1
(
t
*
testing
.
T
)
{
if
Version
()
!=
"v1
beta1
"
{
if
Version
()
!=
"v1"
{
// Skip the test if we are not testing v1
beta1
.
// Skip the test if we are not testing v1.
return
return
}
}
...
@@ -156,10 +156,10 @@ func TestResourcePathWithNamespaceQueryForV1Beta1(t *testing.T) {
...
@@ -156,10 +156,10 @@ func TestResourcePathWithNamespaceQueryForV1Beta1(t *testing.T) {
name
string
name
string
expected
string
expected
string
}{
}{
{
"resource"
,
"mynamespace"
,
"myresource"
,
"/api/v1
beta1/resource/myresource?namespace=mynamespa
ce"
},
{
"resource"
,
"mynamespace"
,
"myresource"
,
"/api/v1
/namespaces/mynamespace/resource/myresour
ce"
},
{
"resource"
,
""
,
"myresource"
,
"/api/v1
beta1
/resource/myresource"
},
{
"resource"
,
""
,
"myresource"
,
"/api/v1/resource/myresource"
},
{
"resource"
,
"mynamespace"
,
""
,
"/api/v1
beta1/resource?namespace=mynamespa
ce"
},
{
"resource"
,
"mynamespace"
,
""
,
"/api/v1
/namespaces/mynamespace/resour
ce"
},
{
"resource"
,
""
,
""
,
"/api/v1
beta1
/resource"
},
{
"resource"
,
""
,
""
,
"/api/v1/resource"
},
}
}
for
_
,
item
:=
range
testCases
{
for
_
,
item
:=
range
testCases
{
if
actual
:=
ResourcePathWithNamespaceQuery
(
item
.
resource
,
item
.
namespace
,
item
.
name
);
actual
!=
item
.
expected
{
if
actual
:=
ResourcePathWithNamespaceQuery
(
item
.
resource
,
item
.
namespace
,
item
.
name
);
actual
!=
item
.
expected
{
...
...
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