Skip to content

Commit

Permalink
corrected milisecond precision in get_file_modification_time tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoFerraces committed Jan 14, 2024
1 parent d2a03b2 commit 8c90915
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mezcla/tests/test_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,16 +568,16 @@ def test_get_file_modification_time(self):
filedir1 = gh.create_temp_file('test modified time')
filedir2 = gh.create_temp_file('test modified time2')
# get the modification time of the files
timestamp1 = THE_MODULE.get_file_modification_time(filedir1)
timestamp2 = THE_MODULE.get_file_modification_time(filedir2)
timestamp1 = THE_MODULE.get_file_modification_time(filedir1)[:19]
timestamp2 = THE_MODULE.get_file_modification_time(filedir2)[:19]
# get and format local time
timestampNow = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())

# test timestamps are equal
assert timestamp1 == timestamp2

# test timestamp is equal to actual time (ignoring miliseconds)
assert timestamp1[:19] == timestampNow
assert timestamp1 == timestampNow

def test_remove_extension(self):
"""Ensure remove_extension works as expected"""
Expand Down

0 comments on commit 8c90915

Please sign in to comment.