From 63a2960c87a4f39cfbe4b809da3affb1500f4b03 Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Fri, 2 May 2014 23:49:03 +0200 Subject: [PATCH] Add one more testcase --- tests/test_cli.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/test_cli.py b/tests/test_cli.py index 69faf96..d8b0f71 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -64,3 +64,21 @@ def test_storage_instance_from_config(monkeypatch): monkeypatch.setitem(vdirsyncer.storage.storage_names, 'lol', lol) config = {'type': 'lol', 'foo': 'bar', 'baz': 1} assert cli.storage_instance_from_config(config) == 'OK' + + +def test_parse_pairs_args(): + pairs = { + 'foo': ('bar', 'baz', {'conflict_resolution': 'a wins'}, + {'storage_option': True}), + 'one': ('two', 'three', {'collections': 'a,b,c'}, {}), + 'eins': ('zwei', 'drei', {'ha': True}, {}) + } + assert list( + cli.parse_pairs_args(['foo/foocoll', 'one', 'eins'], pairs) + ) == [ + ('foo', 'foocoll'), + ('one', 'a'), + ('one', 'b'), + ('one', 'c'), + ('eins', None) + ]