Пример #1
0
 def test_registers_class(self):
     Cls = stanza.make_application_error(
         "TestError",
         ("uri:foo", "bar"),
     )
     self.assertSequenceEqual(self._as_application_condition.mock_calls,
                              [unittest.mock.call(Cls)])
Пример #2
0
 def test_creates_xso_class(self):
     Cls = stanza.make_application_error(
         "TestError",
         ("uri:foo", "bar"),
     )
     self.assertTrue(issubclass(Cls, xso.XSO))
     self.assertIsInstance(Cls, xso.model.XMLStreamClass)
     self.assertEqual(Cls.TAG, ("uri:foo", "bar"))
     self.assertEqual(Cls.__name__, "TestError")
Пример #3
0
 def test_creates_xso_class(self):
     Cls = stanza.make_application_error(
         "TestError",
         ("uri:foo", "bar"),
     )
     self.assertTrue(issubclass(Cls, xso.XSO))
     self.assertIsInstance(Cls, xso.model.XMLStreamClass)
     self.assertEqual(Cls.TAG, ("uri:foo", "bar"))
     self.assertEqual(Cls.__name__, "TestError")
Пример #4
0
 def test_registers_class(self):
     Cls = stanza.make_application_error(
         "TestError",
         ("uri:foo", "bar"),
     )
     self.assertSequenceEqual(
         self._as_application_condition.mock_calls,
         [
             unittest.mock.call(Cls)
         ]
     )