Commit 92d42d65 authored by Jason Frisvold's avatar Jason Frisvold
Browse files

- Add additional test to cover all cases

parent c01541f0
......@@ -73,6 +73,8 @@ class TestSkynetTimer(object):
assert testtimer.timer_id == 11
def test_set_timer_id(self, testtimer):
testtimer.timer_id = None
assert testtimer.timer_id == None
testtimer.timer_id = 42
assert testtimer.timer_id == 42
......@@ -86,8 +88,18 @@ class TestSkynetTimer(object):
def test_set_minute(self, testtimer):
testtimer.minute = '1,22'
assert testtimer.minute == [1, 22]
testtimer.minute = '1,61'
assert testtimer.minute == [0]
testtimer.minute = '-1,6'
assert testtimer.minute == [0]
testtimer.minute = '*'
assert testtimer.minute == ['*']
testtimer.minute = '0-5/1'
assert testtimer.minute == [0, 1, 2, 3, 4, 5]
testtimer.minute = '*/20'
assert testtimer.minute == [0, 20, 40]
testtimer.minute = '0-5/61'
assert testtimer.minute == [0]
def test_del_minute(self, testtimer):
del testtimer.minute
......@@ -101,6 +113,8 @@ class TestSkynetTimer(object):
assert testtimer.hour == [3, 5, 23]
testtimer.hour = '3,5,24'
assert testtimer.hour == [0]
testtimer.hour = '*'
assert testtimer.hour == ['*']
testtimer.hour = '-3,5'
assert testtimer.hour == [0]
testtimer.hour = '0-10/5'
......@@ -120,6 +134,8 @@ class TestSkynetTimer(object):
def test_set_day(self, testtimer):
testtimer.day = '3,5,23'
assert testtimer.day == [3, 5, 23]
testtimer.day = '*'
assert testtimer.day == ['*']
testtimer.day = '3,5,32'
assert testtimer.day == [0]
testtimer.day = '-3,5'
......@@ -142,6 +158,8 @@ class TestSkynetTimer(object):
def test_set_month(self, testtimer):
testtimer.month = '3,5'
assert testtimer.month == [3, 5]
testtimer.month = '*'
assert testtimer.month == ['*']
testtimer.month = '3,5,13'
assert testtimer.month == [0]
testtimer.month = '-3,5'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment