Test acceptable path types of get_mtime_and_size

This commit is contained in:
Aman Sharma
2019-10-31 00:30:54 +05:30
parent e623c4faf7
commit b9a17752e3
+9
View File
@@ -39,6 +39,15 @@ class TestMtimeAndSize(TestDir):
self.assertIs(type(dir_size), str)
self.assertEqual(dir_size, str(actual_dir_size))
def test_path_object_and_str_are_valid_types(self):
dvcignore = DvcIgnoreFilter(self.root_dir)
file_time, file_size = get_mtime_and_size(self.DATA, dvcignore)
file_object_time, file_object_size = get_mtime_and_size(
PathInfo(self.DATA), dvcignore
)
self.assertEqual(file_time, file_object_time)
self.assertEqual(file_size, file_object_size)
class TestContainsLink(TestCase):
def test_should_raise_exception_on_base_path_not_in_path(self):