Exemplo n.º 1
0
    def test_with_adb_command(self):
        with patch('salt.utils.which') as mock:
            mock.return_value = '/usr/bin/adb'

            ret = adb.__virtual__()

            mock.assert_called_once_with('adb')
            self.assertEqual(ret, 'adb')
Exemplo n.º 2
0
    def test_no_adb_command(self):
        with patch('salt.utils.which') as mock:
            mock.return_value = None

            ret = adb.__virtual__()

            mock.assert_called_once_with('adb')
            self.assertFalse(ret)
Exemplo n.º 3
0
def test_with_adb_command():
    with patch("salt.utils.path.which") as mock:
        mock.return_value = "/usr/bin/adb"

        ret = adb.__virtual__()

        mock.assert_called_once_with("adb")
        assert ret == "adb"
Exemplo n.º 4
0
def test_no_adb_command():
    with patch("salt.utils.path.which") as mock:
        mock.return_value = None

        ret = adb.__virtual__()

        mock.assert_called_once_with("adb")
        assert ret == (False, "adb is missing.")
Exemplo n.º 5
0
    def test_with_adb_command(self):
        with patch('salt.utils.which') as mock:
            mock.return_value = '/usr/bin/adb'

            ret = adb.__virtual__()

            mock.assert_called_once_with('adb')
            self.assertEqual(ret, 'adb')
Exemplo n.º 6
0
    def test_no_adb_command(self):
        with patch('salt.utils.which') as mock:
            mock.return_value = None

            ret = adb.__virtual__()

            mock.assert_called_once_with('adb')
            self.assertFalse(ret)