示例#1
0
def test_invalid_plate_number():
    with pytest.raises(ValueError):
        VietnamVehiclePlate.from_string('XXYYZZ11')
示例#2
0
def test_high_capacity_motorcycle(original_string, locality, series):
    plate = VietnamVehiclePlate.from_string(original_string)
    assert plate.vehicle_type == VehicleType.DOMESTIC_MOTORCYCLE_OVER_175CC
    assert plate.locality == locality
    assert plate.series == series
示例#3
0
def test_diplomatic_vehicle(original_string, locality, series, dip_country):
    plate = VietnamVehiclePlate.from_string(original_string)
    assert plate.dip_country == dip_country
示例#4
0
def test_electrical_motorcycle_data(original_string, locality, series):
    plate = VietnamVehiclePlate.from_string(original_string)
    assert plate.vehicle_type == VehicleType.NON_BUSINESS_SPECIAL
    assert plate.locality == locality
    assert plate.series == series
示例#5
0
def test_automobile(original_string, locality, series):
    print(REGEXES[VehicleType.DOMESTIC_AUTOMOBILE])
    plate = VietnamVehiclePlate.from_string(original_string)
    assert plate.vehicle_type == VehicleType.DOMESTIC_AUTOMOBILE
    assert plate.locality == locality
    assert plate.series == series
示例#6
0
def test_not_accept_none():
    with pytest.raises(TypeError):
        VietnamVehiclePlate.from_string(None)
示例#7
0
def test_invalid_type():
    with pytest.raises(TypeError):
        VietnamVehiclePlate.from_string(123)
示例#8
0
def test_daily_life_display(original_string, canonical):
    plate = VietnamVehiclePlate.from_string(original_string)
    assert str(plate) == canonical