def refresh_token(self): new_token = create_token() while not ensure_token_uniqueness(new_token): new_token = create_token() self.token = new_token
def test_create_token_custom_length(self): n = 50 token = create_token(n) assert len(token) == n, "Token was not proper length. It was {0} when it should have been {1}".format(len(token), n)
def test_create_token_fail_non_integer(self): with self.assertRaises(TypeError): token = create_token('80')
def test_basic_create_token(self): token = create_token() assert len(token)