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