Fixes from PR review

This commit is contained in:
Salvatore Ingala
2019-10-10 18:22:33 +07:00
parent aea1d1f1e0
commit 9f25ef8603
12 changed files with 33 additions and 39 deletions

View File

@@ -183,8 +183,3 @@ def test_get_all_appointments_responder():
assert (set(responder_jobs) == set(local_locators))
assert (len(received_appointments["watcher_appointments"]) == 0)

View File

@@ -87,5 +87,3 @@ def test_encrypt():
encrypted_blob2 = blob.encrypt(key)
assert(encrypted_blob == encrypted_blob2 and id(encrypted_blob) != id(encrypted_blob2))

View File

@@ -73,4 +73,3 @@ def test_potential_matches_random_data(locator_uuid_map):
# None of the txids should match
assert len(potential_matches) == 0

View File

@@ -78,4 +78,3 @@ def test_delete_completed_jobs():
Cleaner.delete_completed_jobs(jobs, tx_job_map, completed_jobs, 0)
assert not set(completed_jobs).issubset(jobs.keys())

View File

@@ -34,6 +34,3 @@ def test_decrypt():
encrypted_blob = EncryptedBlob(encrypted_data)
assert(encrypted_blob.decrypt(key) == data)

View File

@@ -230,4 +230,3 @@ def test_inspect():
and appointment.end_time == end_time and appointment.dispute_delta == dispute_delta and
appointment.encrypted_blob.data == encrypted_blob and appointment.cipher == cipher and
appointment.hash_function == hash_function)

View File

@@ -8,9 +8,10 @@ def test_check_txid_format():
assert(check_txid_format(None) is False)
assert(check_txid_format("") is False)
assert(check_txid_format(0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef) is False) # wrong type
assert(check_txid_format("0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef") is True) # lowercase
assert(check_txid_format("0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF") is True) # uppercase
assert(check_txid_format("abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcd") is True) # lowercase
assert(check_txid_format("ABCDEFABCDEFABCDEFABCDEFABCDEFABCDEFABCDEFABCDEFABCDEFABCDEFABCD") is True) # uppercase
assert(check_txid_format("0123456789abcdef0123456789ABCDEF0123456789abcdef0123456789ABCDEF") is True) # mixed case
assert(check_txid_format("0123456789012345678901234567890123456789012345678901234567890123") is True) # only nums
assert(check_txid_format("0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdf") is False) # too short
assert(check_txid_format("0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0") is False) # too long
assert(check_txid_format("g123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef") is False) # non-hex