Пример #1
0
 def test_broken_token(self):
     client = utils.create_client(token='\x1b')
     try:
         client.is_authenticated()
     except exceptions.InvalidRequest as e:
         assert "invalid header value" in str(e)
Пример #2
0
 def test_invalid_token(self):
     client = utils.create_client(token='not-a-real-token')
     assert not client.is_authenticated()
Пример #3
0
 def test_illegal_token(self):
     client = utils.create_client(token='token-with-new-line\n')
     try:
         client.is_authenticated()
     except ValueError as e:
         assert 'Invalid header value' in str(e)
Пример #4
0
 def test_missing_token(self):
     client = utils.create_client()
     assert not client.is_authenticated()