Exemplo n.º 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)
Exemplo n.º 2
0
 def test_invalid_token(self):
     client = utils.create_client(token='not-a-real-token')
     assert not client.is_authenticated()
Exemplo n.º 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)
Exemplo n.º 4
0
 def test_missing_token(self):
     client = utils.create_client()
     assert not client.is_authenticated()