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
508724b1
Commit
508724b1
authored
Dec 01, 2014
by
Vojtech Vitek (V-Teq)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
meta_test should not depend on runtime.TypeMeta
parent
6aabd980
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
meta_test.go
pkg/api/meta/meta_test.go
+5
-5
No files found.
pkg/api/meta/meta_test.go
View file @
508724b1
...
@@ -388,7 +388,7 @@ func TestGenericListMeta(t *testing.T) {
...
@@ -388,7 +388,7 @@ func TestGenericListMeta(t *testing.T) {
}
}
type
MyAPIObject
struct
{
type
MyAPIObject
struct
{
runtime
.
TypeMeta
`yaml:",inline" json
:",inline"`
TypeMeta
InternalTypeMeta
`json:",inline" yaml
:",inline"`
}
}
func
(
*
MyAPIObject
)
IsAnAPIObject
()
{}
func
(
*
MyAPIObject
)
IsAnAPIObject
()
{}
...
@@ -405,8 +405,8 @@ func TestResourceVersionerOfAPI(t *testing.T) {
...
@@ -405,8 +405,8 @@ func TestResourceVersionerOfAPI(t *testing.T) {
}
}
testCases
:=
map
[
string
]
T
{
testCases
:=
map
[
string
]
T
{
"empty api object"
:
{
&
MyAPIObject
{},
""
},
"empty api object"
:
{
&
MyAPIObject
{},
""
},
"api object with version"
:
{
&
MyAPIObject
{
TypeMeta
:
runtime
.
TypeMeta
{
ResourceVersion
:
"1"
}},
"1"
},
"api object with version"
:
{
&
MyAPIObject
{
TypeMeta
:
Internal
TypeMeta
{
ResourceVersion
:
"1"
}},
"1"
},
"pointer to api object with version"
:
{
&
MyAPIObject
{
TypeMeta
:
runtime
.
TypeMeta
{
ResourceVersion
:
"1"
}},
"1"
},
"pointer to api object with version"
:
{
&
MyAPIObject
{
TypeMeta
:
Internal
TypeMeta
{
ResourceVersion
:
"1"
}},
"1"
},
}
}
versioning
:=
NewAccessor
()
versioning
:=
NewAccessor
()
for
key
,
testCase
:=
range
testCases
{
for
key
,
testCase
:=
range
testCases
{
...
@@ -436,7 +436,7 @@ func TestResourceVersionerOfAPI(t *testing.T) {
...
@@ -436,7 +436,7 @@ func TestResourceVersionerOfAPI(t *testing.T) {
runtime
.
Object
runtime
.
Object
Expected
string
Expected
string
}{
}{
"pointer to api object with version"
:
{
&
MyAPIObject
{
TypeMeta
:
runtime
.
TypeMeta
{
ResourceVersion
:
"1"
}},
"1"
},
"pointer to api object with version"
:
{
&
MyAPIObject
{
TypeMeta
:
Internal
TypeMeta
{
ResourceVersion
:
"1"
}},
"1"
},
}
}
for
key
,
testCase
:=
range
setCases
{
for
key
,
testCase
:=
range
setCases
{
if
err
:=
versioning
.
SetResourceVersion
(
testCase
.
Object
,
"5"
);
err
!=
nil
{
if
err
:=
versioning
.
SetResourceVersion
(
testCase
.
Object
,
"5"
);
err
!=
nil
{
...
@@ -460,7 +460,7 @@ func TestTypeMetaSelfLinker(t *testing.T) {
...
@@ -460,7 +460,7 @@ func TestTypeMetaSelfLinker(t *testing.T) {
succeed
bool
succeed
bool
}{
}{
"normal"
:
{
"normal"
:
{
obj
:
&
MyAPIObject
{
TypeMeta
:
runtime
.
TypeMeta
{
SelfLink
:
"foobar"
}},
obj
:
&
MyAPIObject
{
TypeMeta
:
Internal
TypeMeta
{
SelfLink
:
"foobar"
}},
expect
:
"foobar"
,
expect
:
"foobar"
,
try
:
"newbar"
,
try
:
"newbar"
,
succeed
:
true
,
succeed
:
true
,
...
...
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