From f1a824d5e45c007b1d7540a4a6ca5f9d9792f3ab Mon Sep 17 00:00:00 2001 From: Juan-Pablo Scaletti Date: Sun, 31 Mar 2024 17:01:13 -0500 Subject: [PATCH 1/2] test_parse_complex_positional_args --- tests/test_parser.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/test_parser.py b/tests/test_parser.py index 5426a5c..2d0c8f7 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -20,6 +20,21 @@ def test_parse_args(): assert result == expected +def test_parse_complex_positional_args(): + args = [ + "g", + "model", + "Tweet", + "body:text", + "created_at:datetime", + "user:fk-User,backref:'tweets'", + ] + result = parse_args(args) + expected = (args, {}) + print(result) + assert result == expected + + def test_parse_args_list(): result = parse_args(["-f", "1", "-f", "2", "-f", "3"]) expected = ([], {"f": ["1", "2", "3"]}) From 8446894e45c3a2474ef534bca43f5fcfd3b1b7d0 Mon Sep 17 00:00:00 2001 From: Juan-Pablo Scaletti Date: Mon, 1 Apr 2024 09:47:33 -0500 Subject: [PATCH 2/2] test_parse_positional_args_with_double_quotes --- tests/test_parser.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/test_parser.py b/tests/test_parser.py index 2d0c8f7..b04d56f 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -35,6 +35,19 @@ def test_parse_complex_positional_args(): assert result == expected + +def test_parse_positional_args_with_double_quotes(): + args = [ + "model", + 'user:fk-User,backref:"tweets"', + "whatever" + ] + result = parse_args(args) + expected = (args, {}) + print(result) + assert result == expected + + def test_parse_args_list(): result = parse_args(["-f", "1", "-f", "2", "-f", "3"]) expected = ([], {"f": ["1", "2", "3"]})