From 9cc8ebb01bb44e6db6ecdeeea5b522b7bfcf7b59 Mon Sep 17 00:00:00 2001 From: Joakim Soderlund Date: Fri, 8 Jan 2021 20:03:11 +0100 Subject: [PATCH] Fix deprecation warnings from Arrow --- fimfarchive/converters/local_utc.py | 2 +- tests/test_mappers.py | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/fimfarchive/converters/local_utc.py b/fimfarchive/converters/local_utc.py index d1b4eab..2e580e8 100644 --- a/fimfarchive/converters/local_utc.py +++ b/fimfarchive/converters/local_utc.py @@ -50,7 +50,7 @@ class DateNormalizer(JayWalker): """ parsed = arrow.get(value or 0) - if parsed.timestamp == 0: + if parsed.int_timestamp == 0: return None return parsed.to('utc').isoformat() diff --git a/tests/test_mappers.py b/tests/test_mappers.py index 2a1caa9..7c62bec 100644 --- a/tests/test_mappers.py +++ b/tests/test_mappers.py @@ -138,7 +138,7 @@ class TestStoryDateMapper: story = story.merge(meta=meta) - assert mapper(story).timestamp == 5 + assert mapper(story).int_timestamp == 5 def test_meta_with_none_chapters(self, mapper, story): """ @@ -151,7 +151,7 @@ class TestStoryDateMapper: story = story.merge(meta=meta) - assert mapper(story).timestamp == 5 + assert mapper(story).int_timestamp == 5 def test_meta_with_empty_chapters(self, mapper, story): """ @@ -164,7 +164,7 @@ class TestStoryDateMapper: story = story.merge(meta=meta) - assert mapper(story).timestamp == 5 + assert mapper(story).int_timestamp == 5 def test_meta_with_only_chapter_dates(self, mapper, story): """ @@ -180,7 +180,7 @@ class TestStoryDateMapper: story = story.merge(meta=meta) - assert mapper(story).timestamp == 5 + assert mapper(story).int_timestamp == 5 def test_meta_with_only_story_date(self, mapper, story): """ @@ -197,7 +197,7 @@ class TestStoryDateMapper: story = story.merge(meta=meta) - assert mapper(story).timestamp == 5 + assert mapper(story).int_timestamp == 5 def test_meta_with_latest_chapter_date(self, mapper, story): """ @@ -214,7 +214,7 @@ class TestStoryDateMapper: story = story.merge(meta=meta) - assert mapper(story).timestamp == 5 + assert mapper(story).int_timestamp == 5 def test_meta_with_latest_story_date(self, mapper, story): """ @@ -231,7 +231,7 @@ class TestStoryDateMapper: story = story.merge(meta=meta) - assert mapper(story).timestamp == 5 + assert mapper(story).int_timestamp == 5 def test_meta_with_both_latest(self, mapper, story): """ @@ -248,7 +248,7 @@ class TestStoryDateMapper: story = story.merge(meta=meta) - assert mapper(story).timestamp == 5 + assert mapper(story).int_timestamp == 5 class TestStoryPathMapper: