def test_checked_patch_date_missing(self, mock_sql): """Ensure None is returned when no patches match.""" testdb = SktDb(self.database_file) mock_sql.connect().cursor().fetchone.return_value = None result = testdb.get_last_checked_patch_date('baseurl', 'project_id') self.assertIsNone(result)
def test_checked_patch_date(self, mock_sql): """Ensure get_last_checked_patch_date() returns a date.""" testdb = SktDb(self.database_file) mock_sql.connect().cursor().fetchone.return_value = [1] result = testdb.get_last_checked_patch_date('baseurl', 'project_id') self.assertEqual(result, 1)