|
28 | 28 | from vulnerabilities import importer_yielder |
29 | 29 | from vulnerabilities.models import Importer |
30 | 30 |
|
31 | | -MOCK_IMPORTER_REGISTRY = [ |
| 31 | +MOCK_IMPORTERS_REGISTRY = [ |
32 | 32 | { |
33 | 33 | "name": "mock_rust", |
34 | 34 | "license": "https://creativecommons.org/publicdomain/zero/1.0/", |
@@ -65,22 +65,22 @@ def setUp(self): |
65 | 65 | def test_load_importers_freshdb(self): |
66 | 66 | assert Importer.objects.all().count() == 0 |
67 | 67 | with patch( |
68 | | - "vulnerabilities.importer_yielder.IMPORTER_REGISTRY", new=MOCK_IMPORTER_REGISTRY |
| 68 | + "vulnerabilities.importer_yielder.IMPORTERS_REGISTRY", new=MOCK_IMPORTERS_REGISTRY |
69 | 69 | ): # nopep8 |
70 | 70 | self.importer_yielder.load_importers() |
71 | 71 | assert Importer.objects.all().count() == 2 |
72 | 72 |
|
73 | 73 | @pytest.mark.django_db |
74 | 74 | def test_load_importers_setteddb(self): |
75 | 75 | assert Importer.objects.all().count() == 0 |
76 | | - mock_existing_importer = Importer.objects.create(**MOCK_IMPORTER_REGISTRY[1]) |
| 76 | + mock_existing_importer = Importer.objects.create(**MOCK_IMPORTERS_REGISTRY[1]) |
77 | 77 | mock_existing_importer.data_source_cfg["etags"] = {"url": "0x1234"} |
78 | 78 | mock_existing_importer.save() |
79 | 79 |
|
80 | 80 | assert Importer.objects.all().count() == 1 |
81 | 81 |
|
82 | 82 | with patch( |
83 | | - "vulnerabilities.importer_yielder.IMPORTER_REGISTRY", new=MOCK_IMPORTER_REGISTRY |
| 83 | + "vulnerabilities.importer_yielder.IMPORTERS_REGISTRY", new=MOCK_IMPORTERS_REGISTRY |
84 | 84 | ): # nopep8 |
85 | 85 | self.importer_yielder.load_importers() |
86 | 86 | assert Importer.objects.all().count() == 2 |
|
0 commit comments