def test_invalid_plate_number(): with pytest.raises(ValueError): VietnamVehiclePlate.from_string('XXYYZZ11')
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
def test_diplomatic_vehicle(original_string, locality, series, dip_country): plate = VietnamVehiclePlate.from_string(original_string) assert plate.dip_country == dip_country
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
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
def test_not_accept_none(): with pytest.raises(TypeError): VietnamVehiclePlate.from_string(None)
def test_invalid_type(): with pytest.raises(TypeError): VietnamVehiclePlate.from_string(123)
def test_daily_life_display(original_string, canonical): plate = VietnamVehiclePlate.from_string(original_string) assert str(plate) == canonical