Example #1
0
    def test_no_adb_command(self):
        with patch('salt.utils.which') as mock:
            mock.return_value = None

            ret = glxinfo.__virtual__()

            mock.assert_called_once_with('glxinfo')
            self.assertFalse(ret)
Example #2
0
    def test_with_adb_command(self):
        with patch('salt.utils.which') as mock:
            mock.return_value = '/usr/bin/glxinfo'

            ret = glxinfo.__virtual__()

            mock.assert_called_once_with('glxinfo')
            self.assertEqual(ret, 'glxinfo')
Example #3
0
    def test_with_adb_command(self):
        with patch('salt.utils.which') as mock:
            mock.return_value = '/usr/bin/glxinfo'

            ret = glxinfo.__virtual__()

            mock.assert_called_once_with('glxinfo')
            self.assertEqual(ret, 'glxinfo')
Example #4
0
    def test_no_adb_command(self):
        with patch('salt.utils.which') as mock:
            mock.return_value = None

            ret = glxinfo.__virtual__()

            mock.assert_called_once_with('glxinfo')
            self.assertFalse(ret)
Example #5
0
def test_with_glxinfo_command():
    with patch("salt.utils.path.which") as mock:
        mock.return_value = "/usr/bin/glxinfo"

        ret = glxinfo.__virtual__()

        mock.assert_called_once_with("glxinfo")
        assert ret == "glxinfo"
Example #6
0
def test_no_glxinfo_command():
    with patch("salt.utils.path.which") as mock:
        mock.return_value = None

        ret = glxinfo.__virtual__()

        mock.assert_called_once_with("glxinfo")
        assert ret == (False, "glxinfo is missing.")
Example #7
0
    def test_no_glxinfo_command(self):
        with patch("salt.utils.path.which") as mock:
            mock.return_value = None

            ret = glxinfo.__virtual__()

            mock.assert_called_once_with("glxinfo")
            self.assertFalse(ret)