Skip to content

Commit 2a6f618

Browse files
change Duration test to allow for float as sec value, added test for sec remainder + nsec addition
1 parent a6df8d0 commit 2a6f618

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

tests/robots/test_duration.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@ def test_seconds():
66
assert d.seconds == 2.5
77

88

9-
def test_ctor_only_takes_integers():
10-
d = Duration(2.5, 5e+8)
11-
assert d.seconds == 2.5
9+
def test_ctor_takes_sec_as_float():
10+
d = Duration(2.6, 0)
11+
assert d.seconds == 2.6
12+
13+
14+
def test_sec_remainder_add_to_nsec():
15+
d = Duration(2.6, 5e+8)
16+
assert d.seconds == 3.1
1217

1318

1419
def test_repr():

0 commit comments

Comments
 (0)