예제 #1
0
파일: vpp.py 프로젝트: yalikes/vpp
def main():
    args = parser_arg()
    args.sub_command_name
    if args.sub_command_name == "init":
        init_command(args)
    elif args.sub_command_name == "add":
        add_command(args)
    elif args.sub_command_name == "generate" or args.sub_command_name == "g":
        generate_command(args)
예제 #2
0
def test_generate_command_for_place_commands(line, expected_x, expected_y,
                                             expected_f):
    command = generate_command(line)
    assert type(command) == PlaceCommand
    assert command.directive == "PLACE"
    assert command.x_init == expected_x
    assert command.y_init == expected_y
    assert command.f_init == expected_f
예제 #3
0
def test_generate_command_for_standard_commands(line):
    command = generate_command(line)
    assert type(command) == Command
    assert command.directive == line
예제 #4
0
def test_generator_command_reached_EOF():
    assert generate_command("") is None
예제 #5
0
def test_generate_command_for_bad_commands(bad_line):
    with pytest.raises(InvalidCommand):
        generate_command(bad_line)