Esempio n. 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)
Esempio n. 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')
Esempio n. 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')
Esempio n. 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)
Esempio n. 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"
Esempio n. 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.")
Esempio n. 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)