Esempio n. 1
0
    def test_normalize_args_converts_complex_wrapper_commands(self):
        sudo_rm_rf = shell.wraps('sudo rm -rf')

        command = [sudo_rm_rf, '/Applications/Xcode.app']

        self.assertEqual(shell._normalize_args(command),
                         ['sudo', 'rm', '-rf', '/Applications/Xcode.app'])
Esempio n. 2
0
    def test_normalize_args_converts_wrappers(self):
        sudo = shell.wraps('sudo')
        rm = shell.wraps('rm')

        command = [sudo, rm, '-rf', '/Applications/Xcode.app']

        self.assertEqual(shell._normalize_args(command),
                         ['sudo', 'rm', '-rf', '/Applications/Xcode.app'])
Esempio n. 3
0
    def test_normalize_args_converts_pathlib_path_in_wrapper_commands(self):
        rm_xcode = shell.wraps(['rm', '-rf', Path('/Applications/Xcode.app')])

        self.assertEqual(shell._normalize_args([rm_xcode]),
                         ['rm', '-rf', '/Applications/Xcode.app'])
Esempio n. 4
0
    def test_normalize_args_converts_pathlib_path(self):
        command = ['rm', '-rf', Path('/Applications/Xcode.app')]

        self.assertEqual(shell._normalize_args(command),
                         ['rm', '-rf', '/Applications/Xcode.app'])
Esempio n. 5
0
    def test_normalize_args_accepts_single_wrapper_arg(self):
        rm_xcode = shell.wraps(['rm', '-rf', Path('/Applications/Xcode.app')])

        self.assertEqual(shell._normalize_args(rm_xcode),
                         ['rm', '-rf', '/Applications/Xcode.app'])
Esempio n. 6
0
    def test_normalize_args_list_str(self):
        command = ['rm', '-rf', '/Applications/Xcode.app']

        self.assertEqual(shell._normalize_args(command), command)
Esempio n. 7
0
    def test_normalize_args_splits_basestring(self):
        command = 'rm -rf /Applications/Xcode.app'

        self.assertEqual(shell._normalize_args(command),
                         ['rm', '-rf', '/Applications/Xcode.app'])