Esempio n. 1
0
 def test_store_fingerprint(self, waeup_proxy, tmpdir):
     # we can store a fingerprint
     waeup_proxy.create_student('AB123456')
     fpm_file_path = create_fake_fpm_file(str(tmpdir))
     result = store_fingerprint(
         "http://*****:*****@localhost:61614", "AB123456", 1, fpm_file_path)
     assert result is True
Esempio n. 2
0
 def test_store_fingerprint_unauth(self, waeup_proxy, tmpdir):
     # tries to store fingerprints unauthorized will be blocked
     waeup_proxy.create_student('AB123456')
     fpm_file_path = create_fake_fpm_file(str(tmpdir))
     result = store_fingerprint(
         "http://localhost:61614", "AB123456", 1, fpm_file_path)
     assert result == "Error: 401 Unauthorized"
Esempio n. 3
0
 def test_store_fingerprint_unauth(self, waeup_proxy, tmpdir):
     # tries to store fingerprints unauthorized will be blocked
     waeup_proxy.create_student('AB123456')
     fpm_file_path = create_fake_fpm_file(str(tmpdir))
     result = store_fingerprint("http://localhost:61614", "AB123456", 1,
                                fpm_file_path)
     assert result == "Error: 401 Unauthorized"
Esempio n. 4
0
 def test_store_fingerprint(self, waeup_proxy, tmpdir):
     # we can store a fingerprint
     waeup_proxy.create_student('AB123456')
     fpm_file_path = create_fake_fpm_file(str(tmpdir))
     result = store_fingerprint("http://*****:*****@localhost:61614",
                                "AB123456", 1, fpm_file_path)
     assert result is True
Esempio n. 5
0
 def test_store_fingerprint_invalid_server(self, tmpdir):
     # trying to connect to invalid servers will raise socket errors.
     fpm_file_path = create_fake_fpm_file(str(tmpdir))
     result = store_fingerprint(
         "http://localhost:12345", "AB123456", 1, fpm_file_path)
     assert result == "Error: [Errno 111] Connection refused"
Esempio n. 6
0
 def test_store_fingerprint_invalid_server(self, tmpdir):
     # trying to connect to invalid servers will raise socket errors.
     fpm_file_path = create_fake_fpm_file(str(tmpdir))
     result = store_fingerprint("http://localhost:12345", "AB123456", 1,
                                fpm_file_path)
     assert result == "Error: [Errno 111] Connection refused"
Esempio n. 7
0
 def test_store_fingerprint_faulty_request(self, waeup_proxy, tmpdir):
     # We get an error message when a request fails, not a fault object
     fpm_file_path = create_fake_fpm_file(str(tmpdir))
     result = store_fingerprint("http://*****:*****@localhost:61614",
                                "invalid-id", 1, fpm_file_path)
     assert result.endswith("No such student: 'invalid-id'")
Esempio n. 8
0
 def test_store_fingerprint_faulty_request(self, waeup_proxy, tmpdir):
     # We get an error message when a request fails, not a fault object
     fpm_file_path = create_fake_fpm_file(str(tmpdir))
     result = store_fingerprint(
         "http://*****:*****@localhost:61614", "invalid-id", 1, fpm_file_path)
     assert result.endswith("No such student: 'invalid-id'")