We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c1170c8 commit 9c4ef89Copy full SHA for 9c4ef89
tests/test_utils.py
@@ -0,0 +1,21 @@
1
+import os
2
+import re
3
+
4
+from fdiff.utils import get_file_modtime, file_exists
5
6
+import pytest
7
8
9
+def test_get_file_modtime():
10
+ modtime = get_file_modtime(os.path.join("tests", "testfiles", "test.txt"))
11
+ assert modtime.startswith("2019-09-04T") is True
12
+ regex = re.compile(r"""\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+-\d{2}:\d{2}""")
13
+ assert regex.fullmatch(modtime) is not None
14
15
16
+def test_file_exists_true():
17
+ assert file_exists(os.path.join("tests", "testfiles", "test.txt")) is True
18
19
20
+def test_file_exists_false():
21
+ assert file_exists(os.path.join("tests", "testfiles", "bogus.jpg")) is False
0 commit comments