def test_two_objects(self): str1 = 'monty' str2 = 'python' f_ = StringIO.StringIO('"%s"%s"%s"%s' % (str1, self.terminator, str2, self.terminator)) wrappers.add_terminator(f_, self.terminator) reader = json.Reader(f_) self.assertEqual(str1, reader.read_value()) self.assertEqual(str2, reader.read_value())
def setUp(self): self.f_ = StringIO.StringIO() self.terminator = '#' wrappers.add_terminator(self.f_, self.terminator) self.writer = json.Writer(self.f_, encoding='UTF-8')