Move test_sign_appointment after test_add_appointment, as per PR review

This commit is contained in:
Salvatore Ingala
2019-10-28 11:11:39 +07:00
parent bc9c513317
commit f0143efd14

View File

@@ -102,12 +102,6 @@ def test_init(watcher):
assert type(watcher.responder) is Responder assert type(watcher.responder) is Responder
def test_sign_appointment(watcher):
appointment, _ = generate_dummy_appointment()
signature = watcher.sign_appointment(appointment)
assert is_signature_valid(appointment, signature, public_key)
def test_add_appointment(run_bitcoind, watcher): def test_add_appointment(run_bitcoind, watcher):
# The watcher automatically fires do_watch and do_subscribe on adding an appointment if it is asleep (initial state) # The watcher automatically fires do_watch and do_subscribe on adding an appointment if it is asleep (initial state)
# Avoid this by setting the state to awake. # Avoid this by setting the state to awake.
@@ -122,6 +116,12 @@ def test_add_appointment(run_bitcoind, watcher):
assert is_signature_valid(appointment, sig, public_key) assert is_signature_valid(appointment, sig, public_key)
def test_sign_appointment(watcher):
appointment, _ = generate_dummy_appointment()
signature = watcher.sign_appointment(appointment)
assert is_signature_valid(appointment, signature, public_key)
def test_add_too_many_appointments(watcher): def test_add_too_many_appointments(watcher):
# Any appointment on top of those should fail # Any appointment on top of those should fail
watcher.appointments = dict() watcher.appointments = dict()