Esempio n. 1
0
    def test_repr(self):
        """ Ensure that __repr__() return a valid expression that can be
        used to construct the original object
        """

        self.assertReprEquals(RandomStuff(bigint=123456))

        self.assertReprEquals(StructWithUnionAndOther(string_field="test"))

        self.assertReprEquals(TestUnion(string_field="blah"))
Esempio n. 2
0
 def test_content(self):
     """ Ensure that the content of repr() is what we wanted. We should
     print the members in the same order as it is appeared in Thrift file,
     skipping unset members.
     """
     obj = RandomStuff(bigint=123)
     output = """\
         RandomStuff(
             bigint=123)"""
     self.assertEquals(repr(obj), textwrap.dedent(output))
Esempio n. 3
0
 def test_content(self):
     """ Ensure that the content of repr() is what we wanted. We should
     print the member in the same order as it is appeared in Thrift file.
     """
     obj = RandomStuff(bigint=123)
     output = """\
         RandomStuff(
             a=None,
             b=None,
             c=None,
             d=None,
             myintlist=None,
             bigint=123,
             triple=None)"""
     self.assertEquals(repr(obj), textwrap.dedent(output))