|
20 | 20 | # ScanCode.io is a free software code scanning tool from nexB Inc. and others. |
21 | 21 | # Visit https://github.com/nexB/scancode.io for support and download. |
22 | 22 |
|
23 | | -from django.test import TestCase |
24 | 23 | from fnmatch import fnmatch |
| 24 | +from django.test import TestCase |
25 | 25 |
|
26 | 26 | from scanpipe import pipes |
27 | 27 | from scanpipe.models import CodebaseResource |
@@ -139,19 +139,19 @@ def test_scanpipe_pipes_flag_flag_mapped_resources(self): |
139 | 139 | self.assertEqual("mapped", self.resource1.status) |
140 | 140 | self.assertEqual("mapped", self.resource2.status) |
141 | 141 |
|
142 | | -def test_nuget_ignored_patterns_match_expected_files(): |
143 | | - paths = [ |
144 | | - "package/_rels/.rels", |
145 | | - "package/[Content_Types].xml", |
146 | | - "package/services/metadata/core-properties", |
147 | | - "foo.runtimeconfig.json", |
148 | | - "bar.dll.config", |
149 | | - "baz.exe.config", |
150 | | - "test.shasum", |
151 | | - ] |
152 | | - |
153 | | - for path in paths: |
154 | | - assert any( |
155 | | - fnmatch(path, pattern) |
156 | | - for pattern in flag.NUGET_IGNORED_PATTERNS |
157 | | - ), path |
| 142 | + def test_nuget_ignored_patterns_match_expected_files(self): |
| 143 | + paths = [ |
| 144 | + "package/_rels/.rels", |
| 145 | + "package/[Content_Types].xml", |
| 146 | + "package/services/metadata/core-properties", |
| 147 | + "foo.runtimeconfig.json", |
| 148 | + "bar.dll.config", |
| 149 | + "baz.exe.config", |
| 150 | + "test.shasum", |
| 151 | + ] |
| 152 | + for path in paths: |
| 153 | + matched = any( |
| 154 | + fnmatch(path, pattern) |
| 155 | + for pattern in flag.NUGET_IGNORED_PATTERNS |
| 156 | + ) |
| 157 | + self.assertTrue(matched, path) |
0 commit comments