示例#1
0
    def test_interface(self):
        """
        Ensure that the returned status object implements the correct interface.
        """
        s = status.error(None, None)

        self.assertTrue(status.IStatus.providedBy(s))
示例#2
0
    def test_interface(self):
        """
        Ensure that the returned status object implements the correct interface.
        """
        s = status.error(None, None)

        self.assertTrue(status.IStatus.providedBy(s))
示例#3
0
    def test_return(self):
        """
        Check the attribute allocation.
        """
        s = status.error('foo', 'bar', spam='eggs', gak=[1, 2, 3])

        # core attributes
        self.assertEqual(s.level, 'error')
        self.assertEqual(s.code, 'foo')
        self.assertEqual(s.description, 'bar')

        # extra context
        self.assertEqual(s.spam, 'eggs')
        self.assertEqual(s.gak, [1, 2, 3])
示例#4
0
    def test_return(self):
        """
        Check the attribute allocation.
        """
        s = status.error('foo', 'bar', spam='eggs', gak=[1, 2, 3])

        # core attributes
        self.assertEqual(s.level, 'error')
        self.assertEqual(s.code, 'foo')
        self.assertEqual(s.description, 'bar')

        # extra context
        self.assertEqual(s.spam, 'eggs')
        self.assertEqual(s.gak, [1, 2, 3])