示例#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()