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)