1
0
mirror of https://github.com/github/octodns.git synced 2024-05-11 05:55:00 +00:00

Rework supports_warn_or_except to msg and fallback

This commit is contained in:
Ross McFarland
2021-08-18 16:25:13 -07:00
parent 65f0bfc243
commit 08f9ec56a3
3 changed files with 20 additions and 15 deletions

View File

@@ -457,15 +457,15 @@ class TestBaseProvider(TestCase):
normal = MinimalProvider(strict_supports=False)
# Should log and not expect
normal.supports_warn_or_except('Hello World!')
normal.supports_warn_or_except('Hello World!', 'Goodbye')
normal.log.warning.assert_called_once()
normal.log.warning.assert_has_calls([
call('Hello World!')
call('Hello World!; Goodbye')
])
strict = MinimalProvider(strict_supports=True)
# Should log and not expect
with self.assertRaises(ProviderException) as ctx:
strict.supports_warn_or_except('Hello World!')
strict.supports_warn_or_except('Hello World!', 'Will not see')
self.assertEquals('minimal: Hello World!', text_type(ctx.exception))
strict.log.warning.assert_not_called()