From 5160a9edae467b70cfbd2520f657f0b87d7eb6d9 Mon Sep 17 00:00:00 2001 From: Joakim Soderlund Date: Wed, 6 Mar 2019 12:02:50 +0100 Subject: [PATCH] Compare enumeration instances by identity See https://docs.python.org/3.7/library/enum.html#comparisons --- tests/test_mappers.py | 6 +++--- tests/test_utils.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test_mappers.py b/tests/test_mappers.py index 880ceb0..3ff2584 100644 --- a/tests/test_mappers.py +++ b/tests/test_mappers.py @@ -5,7 +5,7 @@ Mapper tests. # # Fimfarchive, preserves stories from Fimfiction. -# Copyright (C) 2018 Joakim Soderlund +# Copyright (C) 2019 Joakim Soderlund # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -440,14 +440,14 @@ class TestMetaFormatMapper: Tests alpha meta format is detected. """ story = self.merge(story, alpha, 'misc') - assert mapper(story) == MetaFormat.ALPHA + assert mapper(story) is MetaFormat.ALPHA def test_beta_format(self, mapper, story, beta): """ Tests beta meta format is detected. """ story = self.merge(story, beta, 'misc') - assert mapper(story) == MetaFormat.BETA + assert mapper(story) is MetaFormat.BETA def test_conflict(self, mapper, story, alpha, beta): """ diff --git a/tests/test_utils.py b/tests/test_utils.py index 2fe3b88..d195bba 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -5,7 +5,7 @@ Utility tests. # # Fimfarchive, preserves stories from Fimfiction. -# Copyright (C) 2015 Joakim Soderlund +# Copyright (C) 2019 Joakim Soderlund # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -283,7 +283,7 @@ class TestFindFlavor: Tests flavor is returned when present. """ found = find_flavor(story, MetaFormat) - assert found == MetaFormat.BETA + assert found is MetaFormat.BETA def test_missing_flavor(self, story): """