def test_generate_fiscal_period_malformed_date_month_year():
    date = datetime.strptime('10/2018', '%m/%Y').date
    with pytest.raises(Exception):
        generate_fiscal_period(date)
def test_generate_fiscal_period_middle_of_fiscal_year():
    date = datetime.strptime('01/01/2019', '%m/%d/%Y')
    expected = 4
    actual = generate_fiscal_period(date)
    assert actual == expected
def test_generate_fiscal_period_incorrect_data_type_int():
    with pytest.raises(TypeError):
        generate_fiscal_period(2019)
def test_generate_fiscal_period_beginning_of_fiscal_year():
    date = datetime.strptime('10/01/2018', '%m/%d/%Y')
    expected = 1
    actual = generate_fiscal_period(date)
    assert actual == expected
def test_generate_fiscal_period_end_of_fiscal_year():
    date = datetime.strptime('09/30/2019', '%m/%d/%Y')
    expected = 12
    actual = generate_fiscal_period(date)
    assert actual == expected
def test_generate_fiscal_period_malformed_date_month_year():
    date = datetime.strptime("10/2018", "%m/%Y").date
    with pytest.raises(Exception):
        generate_fiscal_period(date)
def test_generate_fiscal_period_incorrect_data_type_int():
    with pytest.raises(TypeError):
        generate_fiscal_period(2019)
def test_generate_fiscal_period_middle_of_fiscal_year():
    date = datetime.strptime("01/01/2019", "%m/%d/%Y")
    expected = 4
    actual = generate_fiscal_period(date)
    assert actual == expected
def test_generate_fiscal_period_end_of_fiscal_year():
    date = datetime.strptime("09/30/2019", "%m/%d/%Y")
    expected = 12
    actual = generate_fiscal_period(date)
    assert actual == expected
def test_generate_fiscal_period_beginning_of_fiscal_year():
    date = datetime.strptime("10/01/2018", "%m/%d/%Y")
    expected = 1
    actual = generate_fiscal_period(date)
    assert actual == expected