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
def enter_invalid_month(birth_year): FullRetirementAge.calculate_retirement_age(birth_year)
def get_year_validation(valid, input): assert str(FullRetirementAge.validate_birth_month(input)) == valid
def enter_invalid_month(input): FullRetirementAge.validate_birth_month(input)
def enter_invalid_year(input): FullRetirementAge.validate_birth_year(input)
def test_calculate_retirement_age_years(year, a, b): a2, b2 = FullRetirementAge.calculate_retirement_age(year) assert a2 == a assert b2 == b
def test_validate_birth_month_non_int(): assert FullRetirementAge.validate_birth_month('a') == False
def frac(): FullRetirementAge.main()
def test_validate_birth_year_1899(): assert FullRetirementAge.validate_birth_year(1899) == False
def test_validate_year_next_year(): assert FullRetirementAge.validate_birth_year(datetime.datetime.now().year + 1) == False
def test_validate_birth_year_non_int(): assert FullRetirementAge.validate_birth_year("a") == False
def test_calculate_retirement_age(): full_retirement_age = FullRetirementAge.find_year(1941) assert full_retirement_age[0] == 65 assert full_retirement_age[1] == 8
def test_calculate_retirement_age(monkeypatch): monkeypatch.setattr('builtins.input', lambda _: '1899') with pytest.raises(ValueError): assert FullRetirementAge.user_year() == 1899
def enter_invalid_month(birth_year, birth_month, age_years, age_months): FullRetirementAge.calculate_retirement_date(birth_year, birth_month, age_years, age_months)
def test_validate_birth_month_13(): assert FullRetirementAge.validate_birth_month(13) == False
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)
def frac_year(year, month): FullRetirementAge.retirement_calculator(year, month)