Esempio n. 1
0
def test_call_with_wrong_operation(parser):
    with pytest.raises(SystemExit):
        args = parser.parse_args(['--sum', '10'])
        call_calculator(args=args)
Esempio n. 2
0
def test_div_operations(parser, args, expected):
    args = parser.parse_args(['--div'] + args)
    assert call_calculator(args) == expected
Esempio n. 3
0
def test_one_arg_no_numbers_exits(parser):
    with pytest.raises(SystemExit):
        args = parser.parse_args(['--add'])
        call_calculator(args=args)