Closed sidcha closed 9 months ago
Fixes: #133
This looks good to me.
I would recommend adding the following to test_status.py
to ensure that things work properly when the CP goes away:
def test_pd_status_afer_connection():
cp.stop()
time.sleep(1)
assert pd.is_online() == False
cp.start()
assert cp.sc_wait(pd.address)
assert pd.is_online()
cp.stop()
time.sleep(1)
assert pd.is_online() == False
cp.start() # ensure CP is running for proper tear-down
Good catch, thanks for the review. Will make the change and merge it.
This looks good to me.
I would recommend adding the following to
test_status.py
to ensure that things work properly when the CP goes away:def test_pd_status_afer_connection(): cp.stop() time.sleep(1) assert pd.is_online() == False cp.start() assert cp.sc_wait(pd.address) assert pd.is_online() cp.stop() time.sleep(1) assert pd.is_online() == False cp.start() # ensure CP is running for proper tear-down
Okay, I thought the last line with comment "ensure CP is running for proper tear-down" was what I missed. But now I see that you are suggesting a new test. This case already covered in other tests because at the point of test module entry, CP and PD is already running and SC active. I will merge this PR as is.
Also add tests for the added PD status.