File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -1509,9 +1509,15 @@ def test_send_receive_locations(acfactory, lp):
15091509 assert locations [0 ].latitude == 2.0
15101510 assert locations [0 ].longitude == 3.0
15111511 assert locations [0 ].accuracy == 0.5
1512- assert locations [0 ].timestamp > now
15131512 assert locations [0 ].marker is None
15141513
1514+ # Make sure the timestamp is not in the past.
1515+ # Note that location timestamp has only 1 second precision,
1516+ # while `now` has a fractional part, so we have to truncate it
1517+ # first, otherwise `now` may appear to be in the future
1518+ # even though it is the same second.
1519+ assert int (locations [0 ].timestamp .timestamp ()) >= int (now .timestamp ())
1520+
15151521 contact = ac2 .create_contact (ac1 )
15161522 locations2 = chat2 .get_locations (contact = contact )
15171523 assert len (locations2 ) == 1
You can’t perform that action at this time.
0 commit comments