Files
@ 5784068904e8
Branch filter:
Location: NPO-Accounting/conservancy_beancount/tests/test_ranges.py - annotation
5784068904e8
1.9 KiB
text/x-python
payroll-type — US:403b:Employee:Roth — needed separate since taxable
Since Roth contributions are taxable, there are some reports that
need to include these amounts in total salary (i.e., when running a
report that seeks to show total taxable income for an employee). As
such, we need a `payroll-type` specifically for Roth 403(b)
contributions.
Since Roth contributions are taxable, there are some reports that
need to include these amounts in total salary (i.e., when running a
report that seeks to show total taxable income for an employee). As
such, we need a `payroll-type` specifically for Roth 403(b)
contributions.
a2ee9c73fe38 a2ee9c73fe38 1b7fdf4f3b00 a2ee9c73fe38 1b7fdf4f3b00 1b7fdf4f3b00 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 a2ee9c73fe38 | """test_ranges.py - Unit tests for range classes"""
# Copyright © 2020 Brett Smith
# License: AGPLv3-or-later WITH Beancount-Plugin-Additional-Permission-1.0
#
# Full copyright and licensing details can be found at toplevel file
# LICENSE.txt in the repository.
import datetime
import pytest
from conservancy_beancount import ranges
ONE_DAY = datetime.timedelta(days=1)
@pytest.mark.parametrize('start,stop', [
# One month
(datetime.date(2018, 3, 1), datetime.date(2018, 4, 1)),
# Three months
(datetime.date(2018, 6, 1), datetime.date(2018, 9, 1)),
# Six months, spanning year
(datetime.date(2018, 9, 1), datetime.date(2019, 3, 1)),
# Nine months
(datetime.date(2018, 2, 1), datetime.date(2018, 12, 1)),
# Twelve months on Jan 1
(datetime.date(2018, 1, 1), datetime.date(2019, 1, 1)),
# Twelve months spanning year
(datetime.date(2018, 3, 1), datetime.date(2019, 3, 1)),
# Eighteen months spanning year
(datetime.date(2018, 3, 1), datetime.date(2019, 9, 1)),
# Wild
(datetime.date(2018, 1, 1), datetime.date(2020, 4, 15)),
])
def test_date_range(start, stop):
date_range = ranges.DateRange(start, stop)
assert (start - ONE_DAY) not in date_range
assert start in date_range
assert (start + ONE_DAY) in date_range
assert (stop - ONE_DAY) in date_range
assert stop not in date_range
assert (stop + ONE_DAY) not in date_range
def test_date_range_one_day():
start = datetime.date(2018, 7, 1)
date_range = ranges.DateRange(start, start + ONE_DAY)
assert (start - ONE_DAY) not in date_range
assert start in date_range
assert (start + ONE_DAY) not in date_range
def test_date_range_empty():
date = datetime.date(2018, 8, 10)
date_range = ranges.DateRange(date, date)
assert (date - ONE_DAY) not in date_range
assert date not in date_range
assert (date + ONE_DAY) not in date_range
|