コード例 #1
0
ファイル: oglconform_tests.py プロジェクト: rib/piglit
def test_make_profile_missing(mock_temp):
    """tests.oglconform._make_profile: handles missing groups"""
    io_ = mock.Mock(wraps=StringIO(u'test.name\n'))
    io_.name = mock.Mock()
    mock_file = mock.MagicMock()
    mock_file.__enter__.return_value = io_
    mock_temp.return_value = mock_file

    with mock.patch('subprocess.call', mock.Mock()):
        oglconform._make_profile()
コード例 #2
0
def test_make_profile_missing(mock_temp):
    """tests.oglconform._make_profile: handles missing groups"""
    io_ = mock.Mock(wraps=StringIO(u'test.name\n'))
    io_.name = mock.Mock()
    mock_file = mock.MagicMock()
    mock_file.__enter__.return_value = io_
    mock_temp.return_value = mock_file

    with mock.patch('subprocess.call', mock.Mock()):
        oglconform._make_profile()
コード例 #3
0
    def test_missing(self, mocker):
        """tests.oglconform._make_profile: handles missing groups"""
        io_ = mocker.Mock(wraps=StringIO(u'test.name\n'))
        io_.name = mocker.Mock()

        mock_file = mocker.MagicMock()
        mock_file.__enter__.return_value = io_

        mock_temp = mocker.patch.object(oglconform.tempfile,
                                        'NamedTemporaryFile')
        mock_temp.return_value = mock_file

        mocker.patch('subprocess.call', mocker.Mock())
        oglconform._make_profile()
コード例 #4
0
ファイル: test_oglconform.py プロジェクト: chemecse/piglit
    def test_missing(self, mocker):
        """tests.oglconform._make_profile: handles missing groups"""
        io_ = mocker.Mock(wraps=StringIO(u'test.name\n'))
        io_.name = mocker.Mock()

        mock_file = mocker.MagicMock()
        mock_file.__enter__.return_value = io_

        mock_temp = mocker.patch.object(oglconform.tempfile,
                                        'NamedTemporaryFile')
        mock_temp.return_value = mock_file

        mocker.patch('subprocess.call', mocker.Mock())
        oglconform._make_profile()
コード例 #5
0
ファイル: oglconform_tests.py プロジェクト: rib/piglit
def test_make_profile(mock_temp):
    """tests.oglconform._make_profile: Adds test names"""
    io_ = mock.Mock(wraps=StringIO(u'group test.name\n'))
    io_.name = mock.Mock()
    mock_file = mock.MagicMock()
    mock_file.__enter__.return_value = io_
    mock_temp.return_value = mock_file

    with mock.patch('subprocess.call', mock.Mock()):
        profile = oglconform._make_profile()

    name = grouptools.join('oglconform', 'group', 'test.name')
    nt.ok_(name in profile.test_list,
           msg='{} not in {}'.format(name, profile.test_list.keys()))
コード例 #6
0
def test_make_profile(mock_temp):
    """tests.oglconform._make_profile: Adds test names"""
    io_ = mock.Mock(wraps=StringIO(u'group test.name\n'))
    io_.name = mock.Mock()
    mock_file = mock.MagicMock()
    mock_file.__enter__.return_value = io_
    mock_temp.return_value = mock_file

    with mock.patch('subprocess.call', mock.Mock()):
        profile = oglconform._make_profile()

    name = grouptools.join('oglconform', 'group', 'test.name')
    nt.ok_(name in profile.test_list,
           msg='{} not in {}'.format(name, profile.test_list.keys()))
コード例 #7
0
    def test_basic(self, mocker):
        """tests.oglconform._make_profile: Adds test names"""
        io_ = mocker.Mock(wraps=StringIO(u'group test.name\n'))
        io_.name = mocker.Mock()

        mock_file = mocker.MagicMock()
        mock_file.__enter__.return_value = io_

        mock_temp = mocker.patch.object(oglconform.tempfile,
                                        'NamedTemporaryFile')
        mock_temp.return_value = mock_file

        mocker.patch('subprocess.call', mocker.Mock())
        profile = oglconform._make_profile()

        name = grouptools.join('oglconform', 'group', 'test.name')
        assert name in profile.test_list
コード例 #8
0
ファイル: test_oglconform.py プロジェクト: chemecse/piglit
    def test_basic(self, mocker):
        """tests.oglconform._make_profile: Adds test names"""
        io_ = mocker.Mock(wraps=StringIO(u'group test.name\n'))
        io_.name = mocker.Mock()

        mock_file = mocker.MagicMock()
        mock_file.__enter__.return_value = io_

        mock_temp = mocker.patch.object(oglconform.tempfile,
                                        'NamedTemporaryFile')
        mock_temp.return_value = mock_file

        mocker.patch('subprocess.call', mocker.Mock())
        profile = oglconform._make_profile()

        name = grouptools.join('oglconform', 'group', 'test.name')
        assert name in profile.test_list