Skip to content

Commit

Permalink
Improving test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
slightlynybbled committed Jun 14, 2019
1 parent e49f61f commit a6e7d9b
Showing 1 changed file with 35 additions and 5 deletions.
40 changes: 35 additions & 5 deletions tests/test_TestSequence.py
Expand Up @@ -154,8 +154,14 @@ def test_TestSequence_retrieve_by_integer_should_error(normal_test_sequence):
return ts[0]


def test_TestSequence_run(normal_test_sequence):
ts = normal_test_sequence
def test_TestSequence_run():
"""
Checking a normal test sequence.
:param normal_test_sequence:
:return:
"""
ts = ate.TestSequence(sequence=[t1, t2])

assert ts.ready
ts.start()
Expand All @@ -171,16 +177,15 @@ def test_TestSequence_run(normal_test_sequence):
assert ts.in_progress is False


def test_TestSequence_run_attempted_interrupt(normal_test_sequence):
def test_TestSequence_run_attempted_interrupt():
"""
Testing to ensure that an interrupted test sequence is not actually \
interrupted. This test should clearly show in the coverage and in the \
logging messages.
:param normal_test_sequence:
:return:
"""
ts = normal_test_sequence
ts = ate.TestSequence(sequence=[t1, t2])

assert ts.ready
ts.start()
Expand All @@ -197,6 +202,31 @@ def test_TestSequence_run_attempted_interrupt(normal_test_sequence):
assert ts.in_progress is False


def test_TestSequence_run_with_callback():
"""
Testing to ensure that the callback is executed during a normal test \
sequence.
:param normal_test_sequence:
:return:
"""
count = 0

def increment_count(data):
nonlocal count
count += 1

ts = ate.TestSequence(
sequence=[t1, t2],
callback=increment_count)
ts.start()

while(ts.in_progress):
sleep(0.1)

assert count == 1


def test_TestSequence_run_aborted(aborted_test_sequence):
"""
Testing to ensure that the test is aborted, the test indicates that it is \
Expand Down

0 comments on commit a6e7d9b

Please sign in to comment.