Пример #1
0
def test_timex_convert_month():
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="XXXX-01")) == "January"
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="XXXX-05")) == "May"
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="XXXX-12")) == "December"
Пример #2
0
def test_timex_convert_hour_and_minute():
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="T17:30")) == "5:30PM"
    assert TimexConvert.convert_timex_to_string(Timex(timex="T17:00")) == "5PM"
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="T01:30")) == "1:30AM"
    assert TimexConvert.convert_timex_to_string(Timex(timex="T01:00")) == "1AM"
Пример #3
0
def test_timex_convert_full_datetime():
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="1984-01-03T18:30:45")) == "6:30:45PM 3rd January 1984"
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="2000-01-01T00")) == "midnight 1st January 2000"
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="1967-05-29T19:30:00")) == "7:30PM 29th May 1967"
Пример #4
0
def test_timex_convert_month_and_day_of_month_with_correct_abbreviation():
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="XXXX-06-01")) == "1st June"
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="XXXX-06-02")) == "2nd June"
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="XXXX-06-03")) == "3rd June"
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="XXXX-06-04")) == "4th June"
Пример #5
0
def test_timex_convert_time():
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="T17:30:05")) == "5:30:05PM"
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="T02:30:30")) == "2:30:30AM"
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="T00:30:30")) == "12:30:30AM"
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="T12:30:30")) == "12:30:30PM"
Пример #6
0
def test_timex_convert_part_of_the_day():
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="TDT")) == "daytime"
    assert TimexConvert.convert_timex_to_string(Timex(timex="TNI")) == "night"
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="TMO")) == "morning"
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="TAF")) == "afternoon"
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="TEV")) == "evening"
def test_timex_convert_day_of_week():
    assert TimexConvert.convert_timex_to_string(Timex(timex="XXXX-WXX-1")) == "Monday"
    assert TimexConvert.convert_timex_to_string(Timex(timex="XXXX-WXX-2")) == "Tuesday"
    assert TimexConvert.convert_timex_to_string(Timex(timex="XXXX-WXX-3")) == "Wednesday"
    assert TimexConvert.convert_timex_to_string(Timex(timex="XXXX-WXX-4")) == "Thursday"
    assert TimexConvert.convert_timex_to_string(Timex(timex="XXXX-WXX-5")) == "Friday"
    assert TimexConvert.convert_timex_to_string(Timex(timex="XXXX-WXX-6")) == "Saturday"
    assert TimexConvert.convert_timex_to_string(Timex(timex="XXXX-WXX-7")) == "Sunday"
Пример #8
0
def test_timex_convert_every_Year():
    assert TimexConvert.convert_timex_to_string(Timex(timex="P1Y")) == "1 year"
Пример #9
0
def test_timex_convert_every_spring():
    assert TimexConvert.convert_timex_to_string(Timex(timex="SP")) == "spring "
Пример #10
0
def test_timex_convert_date_and_part_of_day():
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="2017-09-07TNI")) == "7th September 2017 night"
Пример #11
0
def test_timex_convert_every_Day():
    assert TimexConvert.convert_timex_to_string(Timex(timex="P1D")) == "1 day"
Пример #12
0
def test_timex_convert_month_and_year():
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="2018-05")) == "May2018"
Пример #13
0
def test_timex_convert_now():
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="PRESENT_REF")) == "now"
Пример #14
0
def test_timex_convert_seconds():
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="PT45S")) == "45 seconds"
Пример #15
0
def test_timex_convert_week_of_month():
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="XXXX-01-W01")) == "firstweek of January"
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="XXXX-08-W03")) == "thirdweek of August"
Пример #16
0
def test_timex_convert_hours():
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="PT5H")) == "5 hours"
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="PT1H")) == "1 hour"
Пример #17
0
def test_timex_convert_minutes():
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="PT30M")) == "30 minutes"
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="PT1M")) == "1 minute"
Пример #18
0
def test_timex_convert_days():
    assert TimexConvert.convert_timex_to_string(Timex(timex="P5D")) == "5 days"
    assert TimexConvert.convert_timex_to_string(Timex(timex="P1D")) == "1 day"
Пример #19
0
def test_timex_convert_weeks():
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="P6W")) == "6 weeks"
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="P9.5W")) == "9.5 weeks"
Пример #20
0
def test_timex_convert_years():
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="P2Y")) == "2 years"
    assert TimexConvert.convert_timex_to_string(Timex(timex="P1Y")) == "1 year"
Пример #21
0
def test_timex_convert_every_winter():
    assert TimexConvert.convert_timex_to_string(Timex(timex="WI")) == "winter "
Пример #22
0
def test_timex_convert_year_season():
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="1999-SU")) == "summer 1999"
Пример #23
0
def test_timex_convert_every_evening():
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="TEV")) == "evening"
Пример #24
0
def test_timex_convert_every_week():
    assert TimexConvert.convert_timex_to_string(Timex(timex="P1W")) == "1 week"
Пример #25
0
def test_timex_convert_complete_date():
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="2017-05-29")) == "29th May 2017"
Пример #26
0
def test_timex_convert_every_October():
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="XXXX-10")) == "October"
Пример #27
0
def test_timex_convert_season():
    assert TimexConvert.convert_timex_to_string(Timex(timex="SU")) == "summer "
    assert TimexConvert.convert_timex_to_string(Timex(timex="WI")) == "winter "
Пример #28
0
def test_timex_convert_every_Sunday():
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="XXXX-WXX-7")) == "Sunday"
Пример #29
0
def test_timex_convert_every_2days():
    assert TimexConvert.convert_timex_to_string(Timex(timex="P2D")) == "2 days"
Пример #30
0
def test_timex_convert_friday_evening():
    assert TimexConvert.convert_timex_to_string(
        Timex(timex="XXXX-WXX-5TEV")) == "Friday evening"