Esempio n. 1
0
def test_month():
    assert month.month_length('September') == 30, 'month length fails'
    assert month.month_length('January') == 31
    assert month.month_length('February', leap_year=True) == 29
    assert month.month_length('February', leap_year=False) == 28
    assert month.month_length('check') == None
Esempio n. 2
0
def test_month_length1():
    '''
    Test suit for month_length function
    '''
    assert month.month_length('September') == 30, "Wrong output. Should be 30"
Esempio n. 3
0
def test_month_length5():
    '''
    Test suit when inputting an invalid string
    '''
    assert month.month_length('Foobar') == None, "Wrong input and output. \
Esempio n. 4
0
def test_month_length4():
    '''
    Test suit for month_length function
    '''
    assert month.month_length(
        'February', leap_year=True) == 29, "Wrong output. Should be 29"
Esempio n. 5
0
def test_month_length3():
    '''
    Test suit for month_length function
    '''
    assert month.month_length('February') == 28, "Wrong output. Should be 28"
Esempio n. 6
0
def test_month_length2():
    '''
    Test suit for month_length function
    '''
    assert month.month_length('May') == 31, "Wrong output. Should be 31"