コード例 #1
0
 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')
コード例 #2
0
 def test_resolve_form_command(self):
     # Given
     tag = 'command'
     # When
     actual = _Envelope._resolve_form(tag)
     # Then
     self.assertIsInstance(actual, _CommandMessageForm)
コード例 #3
0
 def test_resolve_form_event(self):
     # Given
     tag = 'event'
     # When
     actual = _Envelope._resolve_form(tag)
     # Then
     self.assertIsInstance(actual, _EventMessageForm)
コード例 #4
0
 def test_resolve_form_unlinked(self):
     # Given
     tag = 'unlinked'
     # When
     actual = _Envelope._resolve_form(tag)
     # Then
     self.assertIsInstance(actual, _UnlinkedResponseForm)
コード例 #5
0
 def test_resolve_form_link(self):
     # Given
     tag = 'link'
     # When
     actual = _Envelope._resolve_form(tag)
     # Then
     self.assertIsInstance(actual, _LinkRequestForm)
コード例 #6
0
 def test_resolve_form_sync(self):
     # Given
     tag = 'sync'
     # When
     actual = _Envelope._resolve_form(tag)
     # Then
     self.assertIsInstance(actual, _SyncRequestForm)