Skip to content

Commit fcb1796

Browse files
committed
Fix debian tests
Signed-off-by: Shivam Sandbhor <shivam.sandbhor@gmail.com>
1 parent 5fe5507 commit fcb1796

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

vulnerabilities/importers/debian.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,6 @@ def response_is_new(self):
138138
head = requests.head(self.config.debian_tracker_url)
139139
date_str = head.headers.get("last-modified")
140140
last_modified_date = dateparser.parse(date_str)
141-
print('last_modified_date:', type(last_modified_date), last_modified_date)
142-
print('self.config.last_run_date:', type(self.config.last_run_date), self.config.last_run_date)
143141
if self.config.last_run_date:
144142
return self.config.last_run_date < last_modified_date
145143

vulnerabilities/tests/test_debian.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838

3939

4040
class DebianImportTest(TestCase):
41-
4241
@classmethod
4342
def setUpClass(cls) -> None:
4443
fixture_path = os.path.join(TEST_DATA, "debian.json")
@@ -52,10 +51,12 @@ def setUpClass(cls) -> None:
5251
data_source="DebianDataSource",
5352
data_source_cfg={"debian_tracker_url": "https://security.example.com/json"},
5453
)
54+
return super().setUpClass()
5555

56-
@classmethod
57-
def tearDownClass(cls) -> None:
58-
pass
56+
def tearDown(self) -> None:
57+
self.importer.data_source_cfg = {"debian_tracker_url": "https://security.example.com/json"}
58+
self.importer.last_run = dateparser.parse("2019-08-05 13:14:17.733232+05:30")
59+
self.importer.save()
5960

6061
def test_import(self):
6162
runner = ImportRunner(self.importer, 5)

0 commit comments

Comments
 (0)