예제 #1
0
 def refresh_token(self):
   new_token = create_token()
   while not ensure_token_uniqueness(new_token):
       new_token = create_token()
   self.token = new_token
예제 #2
0
 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)
예제 #3
0
 def test_create_token_fail_non_integer(self):
   with self.assertRaises(TypeError):
      token = create_token('80')
예제 #4
0
 def test_basic_create_token(self):
   token = create_token()
   assert len(token)