Ejemplo n.º 1
0
 def test_decode_cannot_parse(self):
     '''Authorization HTTP header should look like "Basic test_api_key"'''
     with pytest.raises(ValueError):
         KeyAuth.decode('test_api_key')
Ejemplo n.º 2
0
 def test_decode_not_basic_auth(self):
     '''Authorization HTTP header should look like "Basic test_api_key"'''
     with pytest.raises(ValueError):
         KeyAuth.decode('Not basic test_api_key')
Ejemplo n.º 3
0
 def test_decode(self):
     assert (
         KeyAuth.decode('Basic test_api_key').encode() == 'test_api_key')