diff --git a/tests/test_cliparse.py b/tests/test_cliparse.py index 0a860fe1..379e2119 100644 --- a/tests/test_cliparse.py +++ b/tests/test_cliparse.py @@ -1,9 +1,10 @@ +import unittest +from argparse import Namespace from httpie.cliparse import HTTPieArgumentParser, KeyValue -from mock import Mock + __author__ = 'vladimir' -import unittest class HTTPieArgumentParserTestCase(unittest.TestCase): @@ -13,7 +14,7 @@ class HTTPieArgumentParserTestCase(unittest.TestCase): self.httpie_argument_parser = self.HTTPieArgumentParserStub() def test_suggest_when_method_set_and_valid(self): - args = Mock() + args = Namespace() args.method = 'GET' args.url = 'http://example.com/' args.items = [] @@ -25,7 +26,7 @@ class HTTPieArgumentParserTestCase(unittest.TestCase): self.assertEquals(args.items, []) def test_suggest_when_method_not_set(self): - args = Mock() + args = Namespace() args.method = None args.url = 'http://example.com/' args.items = [] @@ -37,7 +38,7 @@ class HTTPieArgumentParserTestCase(unittest.TestCase): self.assertEquals(args.items, []) def test_suggest_when_method_set_but_invalid_and_data_field(self): - args = Mock() + args = Namespace() args.method = 'http://example.com/' args.url = 'data=field' args.items = [] @@ -49,7 +50,7 @@ class HTTPieArgumentParserTestCase(unittest.TestCase): self.assertEquals(args.items, [KeyValue(key='data', value='field', sep='=', orig='data=field')]) def test_suggest_when_method_set_but_invalid_and_header_field(self): - args = Mock() + args = Namespace() args.method = 'http://example.com/' args.url = 'test:header' args.items = [] @@ -61,7 +62,7 @@ class HTTPieArgumentParserTestCase(unittest.TestCase): self.assertEquals(args.items, [KeyValue(key='test', value='header', sep=':', orig='test:header')]) def test_suggest_when_method_set_but_invalid_and_item_exists(self): - args = Mock() + args = Namespace() args.method = 'http://example.com/' args.url = 'new_item=a' args.items = [KeyValue(key='old_item', value='b', sep='=', orig='old_item=b')]