diff --git a/README.rst b/README.rst index c88c817c..80379a2b 100644 --- a/README.rst +++ b/README.rst @@ -302,7 +302,7 @@ their type is distinguished only by the separator used: | | The ``==`` separator is used | +-----------------------+-----------------------------------------------------+ | Data Fields | Request data fields to be serialized as a JSON | -| ``field=value``, | object (default), or to be form encoded | +| ``field=value``, | object (default), or to be form-encoded | | ``field=@file.txt`` | (``--form, -f``). | +-----------------------+-----------------------------------------------------+ | Raw JSON fields | Useful when sending JSON and one or | diff --git a/httpie/cli.py b/httpie/cli.py index eeb66a3c..321e452e 100644 --- a/httpie/cli.py +++ b/httpie/cli.py @@ -97,7 +97,7 @@ positional.add_argument( ) positional.add_argument( 'items', - metavar='REQUEST ITEM', + metavar='REQUEST_ITEM', nargs=ZERO_OR_MORE, type=KeyValueArgType(*SEP_GROUP_ALL_ITEMS), help=r""" diff --git a/tests/tests.py b/tests/tests.py index 7d61771a..59c4f1fb 100755 --- a/tests/tests.py +++ b/tests/tests.py @@ -1265,6 +1265,7 @@ class ItemParsingTest(BaseTestCase): self.assertEqual(files['file'][1].read().strip().decode('utf8'), FILE_CONTENT) + class CLIParserTestCase(unittest.TestCase): def test_expand_localhost_shorthand(self): @@ -1277,7 +1278,7 @@ class CLIParserTestCase(unittest.TestCase): self.assertEqual(args.url, 'http://localhost/') - def test_expand_locahost_shorthand_with_port(self): + def test_expand_localhost_shorthand_with_port(self): args = parser.parse_args(args=[':3000'], env=TestEnvironment()) self.assertEqual(args.url, 'http://localhost:3000') @@ -1303,14 +1304,23 @@ class CLIParserTestCase(unittest.TestCase): self.assertEqual(args.url, 'http://::1') def test_dont_expand_longer_ipv6_as_shorthand(self): - args = parser.parse_args(args=['::ffff:c000:0280'], env=TestEnvironment()) - + args = parser.parse_args( + args=['::ffff:c000:0280'], + env=TestEnvironment() + ) self.assertEqual(args.url, 'http://::ffff:c000:0280') def test_dont_expand_full_ipv6_as_shorthand(self): - args = parser.parse_args(args=['0000:0000:0000:0000:0000:0000:0000:0001'], env=TestEnvironment()) + args = parser.parse_args( + args=['0000:0000:0000:0000:0000:0000:0000:0001'], + env=TestEnvironment() + ) + + self.assertEqual( + args.url, + 'http://0000:0000:0000:0000:0000:0000:0000:0001' + ) - self.assertEqual(args.url, 'http://0000:0000:0000:0000:0000:0000:0000:0001') class ArgumentParserTestCase(unittest.TestCase):