Exemplo n.º 1
0
    def test_get_stable_empty(self, mock_sql, mock_get_repoid):
        """Ensure get_stable() returns None when results are empty."""
        testdb = SktDb(self.database_file)
        mock_get_repoid.return_value = 1
        mock_sql.connect().cursor().fetchone.return_value = None
        result = testdb.get_stable('baserepo_id')

        self.assertIsNone(result)
Exemplo n.º 2
0
    def test_get_stable(self, mock_sql, mock_get_repoid):
        """Ensure get_stable() returns baseline_id."""
        testdb = SktDb(self.database_file)
        mock_get_repoid.return_value = 1
        mock_sql.connect().cursor().fetchone.return_value = [1]
        result = testdb.get_stable('baserepo_id')

        self.assertEqual(result, 1)