def test_collect_can_collect_a_directory_tree(self): test_dir = 'about_code_tool/tests/testdata/DateTest' if on_windows: expected = [ (posix_path(UNC_PREFIX + os.path.abspath('about_code_tool/tests/testdata/DateTest/non-supported_date_format.ABOUT'))), (posix_path(UNC_PREFIX + os.path.abspath('about_code_tool/tests/testdata/DateTest/supported_date_format.ABOUT'))) ] else: expected = [ (os.path.abspath('about_code_tool/tests/testdata/DateTest/non-supported_date_format.ABOUT')), (os.path.abspath('about_code_tool/tests/testdata/DateTest/supported_date_format.ABOUT')) ] result = Collector.collect(test_dir) self.assertEqual(sorted(expected), sorted(result))
def test_collect_can_collect_a_single_file(self): test_file = ('about_code_tool/tests/testdata/thirdparty/django_snippets_2413.ABOUT') if on_windows: expected = [posix_path(UNC_PREFIX + os.path.abspath('about_code_tool/tests/testdata/thirdparty/django_snippets_2413.ABOUT'))] else: expected = [os.path.abspath('about_code_tool/tests/testdata/thirdparty/django_snippets_2413.ABOUT')] result = Collector.collect(test_file) self.assertEqual(expected, result)
def rel_path(pth): p = posix_path(pth) return p.partition('/longpath/')[2]