From 2b4af8d4756bc4eef613ec2cdf81a97d3952150b Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Thu, 13 Jun 2013 16:04:04 +0200 Subject: add support for multiple scripts and script arguments. refs #76 --- test/test_cmdline.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/test_cmdline.py') diff --git a/test/test_cmdline.py b/test/test_cmdline.py index e1c5c88d..92e2adbd 100644 --- a/test/test_cmdline.py +++ b/test/test_cmdline.py @@ -1,6 +1,7 @@ import argparse from libmproxy import cmdline import tutils +import os.path def test_parse_replace_hook(): @@ -39,6 +40,18 @@ def test_parse_setheaders(): x = cmdline.parse_setheader("/foo/bar/voing") assert x == ("foo", "bar", "voing") +def test_shlex(): + """ + shlex.split assumes posix=True by default, we do manual detection for windows. + Test whether script paths are parsed correctly + """ + absfilepath = os.path.normcase(os.path.abspath(__file__)) + + parser = argparse.ArgumentParser() + cmdline.common_options(parser) + opts = parser.parse_args(args=["-s",absfilepath]) + + assert os.path.isfile(opts.scripts[0][0]) def test_common(): parser = argparse.ArgumentParser() -- cgit v1.2.3