def test_resolve_form_invalid(self): # Given tag = 'this_is_not_a_valid_form' # When with self.assertRaises(TypeError) as error: _Envelope._resolve_form(tag) # Then message = error.exception.args[0] self.assertEqual(message, 'Invalid form tag: this_is_not_a_valid_form')
def test_resolve_form_command(self): # Given tag = 'command' # When actual = _Envelope._resolve_form(tag) # Then self.assertIsInstance(actual, _CommandMessageForm)
def test_resolve_form_event(self): # Given tag = 'event' # When actual = _Envelope._resolve_form(tag) # Then self.assertIsInstance(actual, _EventMessageForm)
def test_resolve_form_unlinked(self): # Given tag = 'unlinked' # When actual = _Envelope._resolve_form(tag) # Then self.assertIsInstance(actual, _UnlinkedResponseForm)
def test_resolve_form_link(self): # Given tag = 'link' # When actual = _Envelope._resolve_form(tag) # Then self.assertIsInstance(actual, _LinkRequestForm)
def test_resolve_form_sync(self): # Given tag = 'sync' # When actual = _Envelope._resolve_form(tag) # Then self.assertIsInstance(actual, _SyncRequestForm)