Exemple #1
0
def test_trim_args_rejectedKV():
    """
    GIVEN a call to messages via the CLI
    WHEN trim_args is called on the CLI args
    THEN assert the correct args are removed
    """
    kwds = {'type': 'email', 'arg1': None, 'arg2': (), 'arg3': 'valid'}
    kwargs = trim_args(kwds)
    assert kwargs == {'arg3': 'valid'}
Exemple #2
0
def test_trim_args_ListItems():
    """
    GIVEN a call to messages via the CLI
    WHEN trim_args is called on the CLI args
    THEN assert values with keys to/cc/bcc/attach are returned as a list
        instead of the tuple generated by the click package
    """
    kwds = {'to': ('*****@*****.**',), 'cc': ('*****@*****.**',),
            'bcc': ('*****@*****.**', '*****@*****.**'), 'attachments': ('file1',)}
    kwargs = trim_args(kwds)
    assert kwargs == {'to': ['*****@*****.**'], 'cc': ['*****@*****.**'],
            'bcc': ['*****@*****.**', '*****@*****.**'], 'attachments': ['file1']}