Skip to content

Commit

Permalink
Merge pull request #12 from Semi-ATE/nerohmot
Browse files Browse the repository at this point in the history
added some more tests
  • Loading branch information
nerohmot authored Feb 23, 2021
2 parents 5f5b57e + 9450ec9 commit 9ef6b34
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/test_DT.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ def test_init_str_invalid():
assert True
else:
assert False

try:
DT(('fubar',))
except DTError:
assert True
else:
assert False


def test_populate():
Expand Down Expand Up @@ -264,3 +271,4 @@ def test__ge__():

def test__str__():
assert True

7 changes: 7 additions & 0 deletions tests/test_TD.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,10 @@
assert TD(one).__str__() == "1 year 1 month 1 week 1 day 1 hour 1 minute 1 second"
assert TD(two).__str__() == "2 years 2 months 2 weeks 2 days 2 hours 2 minutes 2 seconds"

assert TD(one).seconds() == one
assert TD(one).minutes() == 580981.0166666667
assert TD(one).hours() == 9683.016944444444
assert TD(one).days() == 403.45903935185186
assert TD(one).weeks() == 57.63700562169312
assert TD(one).months() == 13.264406773211567
assert TD(one).years() == 1.105367231100964

0 comments on commit 9ef6b34

Please sign in to comment.