Ejemplo n.º 1
0
 def test_get_fingerprints(self, waeup_proxy):
     # we can retrieve stored fingerprints
     self.populate_db(waeup_proxy)
     result = get_fingerprints(
         "http://*****:*****@localhost:61614", "AB123456")
     assert isinstance(result, dict)
     assert result.get("email", None) == "*****@*****.**"
     assert result.get("firstname", None) == "foo"
     assert result.get("lastname", None) == "bar"
     assert result.get("img", None) is not None
     img = result["img"].data
     assert img == b"FakedPNGFile"
     assert result.get("img_name", None) == "passport.png"
     assert isinstance(result.get("fingerprints", None), dict)
     fprints = result.get("fingerprints")
     assert "1" in fprints.keys()
     fprint = fprints["1"].data
     assert fprint == b"FP1Fake"
Ejemplo n.º 2
0
 def test_get_fingerprints(self, waeup_proxy):
     # we can retrieve stored fingerprints
     self.populate_db(waeup_proxy)
     result = get_fingerprints("http://*****:*****@localhost:61614",
                               "AB123456")
     assert isinstance(result, dict)
     assert result.get("email", None) == "*****@*****.**"
     assert result.get("firstname", None) == "foo"
     assert result.get("lastname", None) == "bar"
     assert result.get("img", None) is not None
     img = result["img"].data
     assert img == b"FakedPNGFile"
     assert result.get("img_name", None) == "passport.png"
     assert isinstance(result.get("fingerprints", None), dict)
     fprints = result.get("fingerprints")
     assert "1" in fprints.keys()
     fprint = fprints["1"].data
     assert fprint == b"FP1Fake"
Ejemplo n.º 3
0
 def test_get_fingerprints_invalid_server(self, waeup_proxy):
     # trying to connect to invalid servers will raise socket errors.
     self.populate_db(waeup_proxy)
     result = get_fingerprints(
         "http://*****:*****@localhost:12345", "AB123456")
     assert result == "Error: [Errno 111] Connection refused"
Ejemplo n.º 4
0
 def test_get_fingerprints_unauth(self, waeup_proxy):
     # we cannot get fingerprints w/o being authorized
     self.populate_db(waeup_proxy)
     result = get_fingerprints(
         "http://*****:*****@localhost:61614", "AB123456")
     assert result == "Error: 401 Unauthorized"
Ejemplo n.º 5
0
 def test_get_fingerprints_invalid_server(self, waeup_proxy):
     # trying to connect to invalid servers will raise socket errors.
     self.populate_db(waeup_proxy)
     result = get_fingerprints("http://*****:*****@localhost:12345",
                               "AB123456")
     assert result == "Error: [Errno 111] Connection refused"
Ejemplo n.º 6
0
 def test_get_fingerprints_unauth(self, waeup_proxy):
     # we cannot get fingerprints w/o being authorized
     self.populate_db(waeup_proxy)
     result = get_fingerprints("http://*****:*****@localhost:61614",
                               "AB123456")
     assert result == "Error: 401 Unauthorized"