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'])
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'])
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'])
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'])
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'])
def test_normalize_args_list_str(self): command = ['rm', '-rf', '/Applications/Xcode.app'] self.assertEqual(shell._normalize_args(command), command)
def test_normalize_args_splits_basestring(self): command = 'rm -rf /Applications/Xcode.app' self.assertEqual(shell._normalize_args(command), ['rm', '-rf', '/Applications/Xcode.app'])