|
13 | 13 | from os.path import exists |
14 | 14 | from os.path import join |
15 | 15 |
|
16 | | -import pytest |
17 | | - |
18 | 16 | from commoncode.fileutils import parent_directory |
19 | 17 | from commoncode.testcase import FileBasedTesting |
20 | 18 | from commoncode.resource import Codebase |
@@ -42,13 +40,16 @@ def test_walk_defaults(self): |
42 | 40 | ] |
43 | 41 | assert [(r.name, r.is_file) for r in results] == expected |
44 | 42 |
|
45 | | - @pytest.mark.xfail(reason='FIXME: a fix for ticket #1422 is needed') |
46 | | - def test_Codebase_with_only_ignores_should_not_fail_to_create(self): |
| 43 | + def test_Codebase_do_not_ignore_by_default_older_sccs_and_rcs_dirs(self): |
| 44 | + # See https://github.com/nexB/scancode-toolkit/issues/1422 |
47 | 45 | from commoncode.fileutils import create_dir |
48 | 46 | test_codebase = self.get_temp_dir() |
49 | 47 | create_dir(join(test_codebase, 'sccs', 'a')) |
50 | 48 | create_dir(join(test_codebase, 'rcs', 'b')) |
51 | | - Codebase(test_codebase) |
| 49 | + codebase = Codebase(test_codebase) |
| 50 | + results = list(codebase.walk(topdown=True, skip_root=True)) |
| 51 | + expected = ['rcs', 'b', 'sccs', 'a'] |
| 52 | + assert [r.name for r in results] == expected |
52 | 53 |
|
53 | 54 | def test_walk_topdown(self): |
54 | 55 | test_codebase = self.get_test_loc('resource/codebase') |
@@ -1055,7 +1056,7 @@ def test_virtual_codebase_can_process_minimal_resources_with_only_path(self): |
1055 | 1056 | ]) |
1056 | 1057 | ] |
1057 | 1058 | assert [r.to_dict() for r in codebase.walk()] == expected |
1058 | | - |
| 1059 | + |
1059 | 1060 | def test_VirtualCodebase_account_fingerprint_attribute(self): |
1060 | 1061 | test_file = self.get_test_loc("resource/virtual_codebase/fingerprint_attribute.json") |
1061 | 1062 | codebase = VirtualCodebase(test_file) |
@@ -1352,7 +1353,6 @@ def test_VirtualCodebase_can_be_created_without_RecursionError(self): |
1352 | 1353 | VirtualCodebase(test_file) |
1353 | 1354 |
|
1354 | 1355 |
|
1355 | | - |
1356 | 1356 | class TestResource(FileBasedTesting): |
1357 | 1357 | test_data_dir = join(dirname(__file__), 'data') |
1358 | 1358 |
|
|
0 commit comments