diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-01-30 07:57:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-01-30 07:57:29 +0000 |
commit | a003430ded2dbfbfb48acd3c17f143cbafeee60a (patch) | |
tree | 9016b0b904b32c46542f48de704b3e536b90e1af /tests/date/test_fluent_setters.py | |
parent | Initial commit. (diff) | |
download | pendulum-a003430ded2dbfbfb48acd3c17f143cbafeee60a.tar.xz pendulum-a003430ded2dbfbfb48acd3c17f143cbafeee60a.zip |
Adding upstream version 2.1.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | tests/date/test_fluent_setters.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/date/test_fluent_setters.py b/tests/date/test_fluent_setters.py new file mode 100644 index 0000000..4eaea8c --- /dev/null +++ b/tests/date/test_fluent_setters.py @@ -0,0 +1,27 @@ +import pendulum + +from ..conftest import assert_date + + +def test_fluid_year_setter(): + d = pendulum.Date(2016, 10, 20) + new = d.set(year=1995) + + assert_date(new, 1995, 10, 20) + assert new.year == 1995 + + +def test_fluid_month_setter(): + d = pendulum.Date(2016, 7, 2) + new = d.set(month=11) + + assert new.month == 11 + assert d.month == 7 + + +def test_fluid_day_setter(): + d = pendulum.Date(2016, 7, 2) + new = d.set(day=9) + + assert new.day == 9 + assert d.day == 2 |