Skip to content

Commit

Permalink
Test deprecation of int where enum is expected
Browse files Browse the repository at this point in the history
  • Loading branch information
jim-easterbrook committed Jan 12, 2024
1 parent 4c41531 commit 6a9e563
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/test_value.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ def do_common_tests(self, value, type_id, string, data, sequence=None):
else:
self.check_result(value.count(), int, len(data))
self.check_result(value.ok(), bool, True)
with self.assertWarns(DeprecationWarning):
result = exiv2.Value.create(int(type_id))
result = exiv2.Value.create(type_id)
self.assertEqual(result.read(string), 0)
self.assertEqual(str(result), string)
Expand Down Expand Up @@ -112,6 +114,8 @@ def do_common_xmp_tests(self, value):
exiv2.XmpValue.XmpArrayType.xaBag,
exiv2.XmpValue.XmpArrayType.xaAlt,
exiv2.XmpValue.XmpArrayType.xaNone):
with self.assertWarns(DeprecationWarning):
value.setXmpArrayType(int(type_))
value.setXmpArrayType(type_)
self.check_result(
value.xmpArrayType(), exiv2.XmpValue.XmpArrayType, type_)
Expand Down

0 comments on commit 6a9e563

Please sign in to comment.