コード例 #1
0
def test_calculate_retirement_date(birth_year, birth_month, age_years,
                                   age_months, expected_year, expected_month):
    y, m = FullRetirementAge.calculate_retirement_date(birth_year, birth_month,
                                                       age_years, age_months)
    actual_age = [y, m]
    expected_age = [expected_year, expected_month]
    assert actual_age == expected_age
コード例 #2
0
def enter_invalid_month(birth_year):
    FullRetirementAge.calculate_retirement_age(birth_year)
コード例 #3
0
def get_year_validation(valid, input):
    assert str(FullRetirementAge.validate_birth_month(input)) == valid
コード例 #4
0
def enter_invalid_month(input):
    FullRetirementAge.validate_birth_month(input)
コード例 #5
0
def enter_invalid_year(input):
    FullRetirementAge.validate_birth_year(input)
コード例 #6
0
def test_calculate_retirement_age_years(year, a, b):
    a2, b2 = FullRetirementAge.calculate_retirement_age(year)
    assert a2 == a
    assert b2 == b
コード例 #7
0
def test_validate_birth_month_non_int():
    assert FullRetirementAge.validate_birth_month('a') == False
コード例 #8
0
def frac():
    FullRetirementAge.main()
コード例 #9
0
def test_validate_birth_year_1899():
    assert FullRetirementAge.validate_birth_year(1899) == False
コード例 #10
0
def test_validate_year_next_year():
    assert FullRetirementAge.validate_birth_year(datetime.datetime.now().year +
                                                 1) == False
コード例 #11
0
def test_validate_birth_year_non_int():
    assert FullRetirementAge.validate_birth_year("a") == False
コード例 #12
0
def test_calculate_retirement_age():
    full_retirement_age = FullRetirementAge.find_year(1941)

    assert full_retirement_age[0] == 65
    assert full_retirement_age[1] == 8
コード例 #13
0
def test_calculate_retirement_age(monkeypatch):
    monkeypatch.setattr('builtins.input', lambda _: '1899')
    with pytest.raises(ValueError):
        assert FullRetirementAge.user_year() == 1899
コード例 #14
0
def enter_invalid_month(birth_year, birth_month, age_years, age_months):
    FullRetirementAge.calculate_retirement_date(birth_year, birth_month,
                                                age_years, age_months)
コード例 #15
0
def test_validate_birth_month_13():
    assert FullRetirementAge.validate_birth_month(13) == False
コード例 #16
0
def get_year_validation(birth_year, birth_month, age_years, age_months,
                        date_year, date_month):
    y, m = FullRetirementAge.calculate_retirement_date(birth_year, birth_month,
                                                       age_years, age_months)
    assert y == int(date_year)
    assert m == int(date_month)
コード例 #17
0
def frac_year(year, month):

    FullRetirementAge.retirement_calculator(year, month)