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