def test_last_checked_patch_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('baseurl', 'project_id') self.assertIsNone(result)
def test_last_checked_patch(self, mock_sql): """Ensure get_last_checked_patch() returns a patch id.""" testdb = SktDb(self.database_file) mock_sql.connect().cursor().fetchone.return_value = [1] result = testdb.get_last_checked_patch('baseurl', 'project_id') self.assertEqual(result, 1)