Exemplo n.º 1
0
    def test_authorize(self):
        api = PhishNetAPI()
        api.authorize(os.getenv("UID"))

        assert api.uid == os.getenv("UID")
        assert api.apikey == os.getenv("APIKEY")
        assert api.appid == int(os.getenv("APPID"))
        assert api.private_salt == os.getenv("PRIVATE_SALT")
        assert 18 <= len(api.authkey) <= 19
Exemplo n.º 2
0
 def test_authorize(self, requests_mock):
     api = PhishNetAPI('apikey123456789test1')
     with open('tests/data/authority.json') as f:
         authority_json = json.load(f)
     requests_mock.post(api.base_url + "authority/get", json=authority_json)
     api.authorize(80, '123456789abcdefghij')
     assert api.uid == 80
     assert api.appid == 12345
     assert api.authkey == "B6386A2485D94C73DAA"