def assertBackAndForth(self, obj): """ Checks that conversion to json and back is idempotent. """ jsonable = thrift2json(obj) back = jsonable2thrift(jsonable, type(obj)) self.assertEquals(obj, back)
def test_default(self): x = jsonable2thrift(dict(), TestManyTypes) self.assertEquals(TestManyTypes(a_string_with_default="the_default"), x)