mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	add unit test for groupversion
This commit is contained in:
		@@ -61,3 +61,33 @@ func TestGetGroup(t *testing.T) {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func TestGetGroupVersion(t *testing.T) {
 | 
				
			||||||
 | 
						testCases := []struct {
 | 
				
			||||||
 | 
							group   string
 | 
				
			||||||
 | 
							version string
 | 
				
			||||||
 | 
							output  string
 | 
				
			||||||
 | 
						}{
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"",
 | 
				
			||||||
 | 
								"v1",
 | 
				
			||||||
 | 
								"v1",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"extensions",
 | 
				
			||||||
 | 
								"",
 | 
				
			||||||
 | 
								"extensions/",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"extensions",
 | 
				
			||||||
 | 
								"v1beta1",
 | 
				
			||||||
 | 
								"extensions/v1beta1",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						for _, test := range testCases {
 | 
				
			||||||
 | 
							actual := GetGroupVersion(test.group, test.version)
 | 
				
			||||||
 | 
							if test.output != actual {
 | 
				
			||||||
 | 
								t.Errorf("expect version: %s, got: %s\n", test.output, actual)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user