Skip to content

Commit

Permalink
Add test method to property_utils
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxcode123 committed Apr 9, 2024
1 parent 17d987f commit 1e540a2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/property_utils/tests/properties/property_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ def assert_result(self, result_str):
self.assertResultIsNot(self.prop())
self.assertSequenceEqual(str(self.cachedResult()), result_str, str)

def assert_result_almost(self, result_str):
self.assertResultIsNot(self.prop())
result = self.cachedResult()
result.value = round(result.value, 2)
self.assertSequenceEqual(str(result), result_str, str)

def _assert_error(self, error: PropertyUtilsException, expected_regex):
if expected_regex is None:
self.assertResultRaises(error)
Expand Down

0 comments on commit 1e540a2

Please sign in to comment.