Skip to content

Commit

Permalink
fix typos and rename constants
Browse files Browse the repository at this point in the history
  • Loading branch information
aditya-purang committed Feb 23, 2024
1 parent 69bb375 commit f8cfd94
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ var (
},
}

listPodResourcesResponseEmptyPodResources = &podresourcesv1.ListPodResourcesResponse{
listPodResourcesResponseWithEmptyPodResources = &podresourcesv1.ListPodResourcesResponse{
PodResources: []*podresourcesv1.PodResources{},
}

listPodResourcesResponseEmptyResponse = &podresourcesv1.ListPodResourcesResponse{}
listPodResourcesResponseWithEmptyResponse = &podresourcesv1.ListPodResourcesResponse{}
)

type MockPodResourcesClient struct {
Expand Down Expand Up @@ -174,7 +174,7 @@ func TestGets(t *testing.T) {
}

func TestGetsWhenThereAreNoPods(t *testing.T) {
store := constructPodResourcesStore(make(map[ContainerInfo][]ResourceInfo), make(map[ResourceInfo]ContainerInfo), listPodResourcesResponseEmptyPodResources, nil)
store := constructPodResourcesStore(make(map[ContainerInfo][]ResourceInfo), make(map[ResourceInfo]ContainerInfo), listPodResourcesResponseWithEmptyPodResources, nil)
store.updateMaps()

assert.Equal(t, 0, len(store.containerInfoToResourcesMap))
Expand All @@ -191,8 +191,8 @@ func TestGetsWhenThereAreNoPods(t *testing.T) {
}
}

func TestGetsWhenPodReourcesResponseIsEmpty(t *testing.T) {
store := constructPodResourcesStore(make(map[ContainerInfo][]ResourceInfo), make(map[ResourceInfo]ContainerInfo), listPodResourcesResponseEmptyResponse, nil)
func TestGetsWhenPodResourcesResponseIsEmpty(t *testing.T) {
store := constructPodResourcesStore(make(map[ContainerInfo][]ResourceInfo), make(map[ResourceInfo]ContainerInfo), listPodResourcesResponseWithEmptyResponse, nil)
store.updateMaps()

assert.Equal(t, 0, len(store.containerInfoToResourcesMap))
Expand All @@ -209,8 +209,8 @@ func TestGetsWhenPodReourcesResponseIsEmpty(t *testing.T) {
}
}

func TestGetsWhenPodReourcesThrowsError(t *testing.T) {
store := constructPodResourcesStore(make(map[ContainerInfo][]ResourceInfo), make(map[ResourceInfo]ContainerInfo), listPodResourcesResponseEmptyResponse, fmt.Errorf("mocked behavior"))
func TestGetsWhenPodResourcesThrowsError(t *testing.T) {
store := constructPodResourcesStore(make(map[ContainerInfo][]ResourceInfo), make(map[ResourceInfo]ContainerInfo), listPodResourcesResponseWithEmptyResponse, fmt.Errorf("mocked behavior"))
store.updateMaps()

assert.Equal(t, 0, len(store.containerInfoToResourcesMap))
Expand Down

0 comments on commit f8cfd94

Please sign in to comment.