added method to check if the ID belongs to a group or container

This commit is contained in:
2021-08-22 18:49:49 +04:00
parent 8a278239ba
commit 4ed2e10ac3
2 changed files with 27 additions and 0 deletions

View File

@@ -102,3 +102,19 @@ func TestRemoveTrackedContainer(t *testing.T) {
t.Fail()
}
}
// Test function that checks if the ID belongs to
// a group or container running
func TestCheckID(t *testing.T) {
id := "grp123"
checkID, err := CheckID(id)
if err != nil {
fmt.Println(err)
t.Fail()
}
if checkID == "group" {
fmt.Println("pass")
} else {
t.Fail()
}
}