示例#1
0
文件: test_db.py 项目: danghai/sktm
    def test_get_baselineresult_empty(self, mock_sql, mock_get_repoid):
        """Ensure __get_baselineresult() returns None for empty results."""
        # pylint: disable=W0212,E1101
        testdb = SktDb(self.database_file)
        mock_get_repoid.return_value = 1
        mock_sql.connect().cursor().fetchone.return_value = None
        result = testdb._SktDb__get_baselineresult('baserepo_id', 'abcdef')

        self.assertIsNone(result)
示例#2
0
文件: test_db.py 项目: danghai/sktm
    def test_get_baselineresult(self, mock_sql, mock_get_repoid):
        """Ensure __get_baselineresult() returns baseline_id."""
        # pylint: disable=W0212,E1101
        testdb = SktDb(self.database_file)
        mock_get_repoid.return_value = 1
        mock_sql.connect().cursor().fetchone.return_value = [1]
        result = testdb._SktDb__get_baselineresult('baserepo_id', 'abcdef')

        self.assertEqual(result, 1)