def test_memberOf_false(self): """When the memberOf param value is a string, and that value DOESN'T exist within the memberOf token array, `acl_in_token` return False. """ output = http_auth.acl_in_token(self.token, memberOf='a-group-never-heard-of') self.assertFalse(output)
def test_memberOf_array_false(self): """When the memberOf param value is a List, and NONE of those values exist within the memberOf token array, `acl_in_token` returns False. """ output = http_auth.acl_in_token( self.token, memberOf=['a-group-never-heard-of', 'some-other-crazy-group']) self.assertFalse(output)
def test_memberOf(self): """When the memberOf param equals the token memberOf, `acl_in_token` returns True.""" output = http_auth.acl_in_token(self.token, memberOf='some-group') self.assertTrue(output)
def test_username_array_false(self): """When the username param is a List and the token DOESN"T contain an element within that list, `acl_in_token` returns False. """ output = http_auth.acl_in_token(self.token, username=['peep-A', 'bro']) self.assertFalse(output)
def test_username_false(self): """When the username param does not equal the token username, `acl_in_token` returns False. """ output = http_auth.acl_in_token(self.token, username='******') self.assertFalse(output)
def test_username_array(self): """When the username param is a List and the token contains an element within that list, `acl_in_token` returns True. """ output = http_auth.acl_in_token(self.token, username=['bob']) self.assertTrue(output)
def test_username(self): """When the username param equals the token username, `acl_in_token` returns True. """ output = http_auth.acl_in_token(self.token, username='******') self.assertTrue(output)
def test_version_array_false(self): """When the version param is a List, the token DOESN'T contain an element within that list, `acl_in_token` returns False. """ output = http_auth.acl_in_token(self.token, version=[1000, 1001]) self.assertFalse(output)
def test_version_false(self): """When the version param does not equal the token version, `acl_in_token` returns False. """ output = http_auth.acl_in_token(self.token, version=1000) self.assertFalse(output)
def test_version_array(self): """When the version param is a List and the token contains an element within that list, `acl_in_token` returns True. """ output = http_auth.acl_in_token(self.token, version=[1, 2]) self.assertTrue(output)
def test_version(self): """When the version param equals the token version, `acl_in_token` returns True. """ output = http_auth.acl_in_token(self.token, version=1) self.assertTrue(output)
def test_defaults_false(self): """When no parameters are set, `acl_in_token` returns False.""" output = http_auth.acl_in_token(self.token) self.assertFalse(output)
def test_memberOf_array(self): """When the memberOf param is a List and the token contains an element within that list, `acl_in_token` returns True.""" output = http_auth.acl_in_token( self.token, memberOf=['some-group', 'a-group-never-heard-of']) self.assertTrue(output)