Exemplo n.º 1
0
    def test_value_dict(self):

        json_out = io.StringIO()
        writer = json.write_dict(json_out, 0)
        writer.put("key1", "value1")
        writer.put("key2", "value2")
        writer.put("key3", "value3")
        writer.close()
        self.assertSameContent(json_out, "value-dict.json")
Exemplo n.º 2
0
	def test_value_dict(self):
	
		json_out = io.StringIO()
		writer = json.write_dict(json_out, 0)
		writer.put("key1", "value1")
		writer.put("key2", "value2")
		writer.put("key3", "value3")
		writer.close()
		self.assertSameContent(json_out, "value-dict.json")
Exemplo n.º 3
0
    def test_stream_complex(self):

        json_out = io.StringIO()
        writer = json.write_dict(json_out, 0)
        writer.put("name", "complex")
        writer.put("complexity", 1)
        wa = writer.put_list("items")
        wa.append("item1")
        wa.append("item2")
        wa.append("item3")
        wa.close()
        wa = writer.put_dict("properties")
        wa.put("type", "stream")
        wa.put("depth", 2)
        wa.close()
        writer.close()
        self.assertSameContent(json_out, "stream-complex.json")
Exemplo n.º 4
0
	def test_stream_complex(self):
	
		json_out = io.StringIO()
		writer = json.write_dict(json_out, 0)
		writer.put("name", "complex")
		writer.put("complexity", 1)
		wa = writer.put_list("items")
		wa.append("item1")
		wa.append("item2")
		wa.append("item3")
		wa.close()
		wa = writer.put_dict("properties")
		wa.put("type", "stream")
		wa.put("depth", 2)
		wa.close()
		writer.close()
		self.assertSameContent(json_out, "stream-complex.json")