Exemplo n.º 1
0
def test_getTime():
    assert pd.getTime("16:30") == time(16, 30)
Exemplo n.º 2
0
def test_getTime_ValueError():
    with pytest.raises(ValueError):
        pd.getTime("25:30")
Exemplo n.º 3
0
def test_getLastDigitLicPlate_ValueError():
    with pytest.raises(ValueError):
        pd.getLastDigitLicPlate("as23344")
Exemplo n.º 4
0
def test_getLastDigitLicPlate():
    assert pd.getLastDigitLicPlate("ABC5612") == 2
Exemplo n.º 5
0
def test_getDate_ValueError():
    with pytest.raises(ValueError):
        pd.getDate("13-13-2020")
Exemplo n.º 6
0
def test_getDate():
    assert pd.getDate("07-10-2020") == datetime(2020, 10, 7)
Exemplo n.º 7
0
import Source.Parsing_Data as pd
import Source.Pico_Placa as pp

info = """Welcome to Pico & Placa Predictor:\n
          Format Plate Number Example: ABC0291\n
          Format Date: DD-MM-YYYY or DD/MM/YYYY or DD MM YYYY\n
          Formate Time: HH:MM or HH MM or HHhMM"""

print(info)
while True:
    try:
        licensePlate = input("Enter a license plate number: ")
        lastDigitLicPlate = pd.getLastDigitLicPlate(licensePlate)
        break
    except ValueError:
        print("Please, type a valid license plate number!")

while True:
    try:
        date = pd.getDate(input("Enter a date: "))
        break
    except ValueError:
        print("Please, type a valid date!")

while True:
    try:
        timeGiven = pd.getTime(input("Especify a time: "))
        break
    except ValueError:
        print("Please, especify a valid time!")