mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 07:31:38 +00:00 
			
		
		
		
	
		
			
	
	
		
			14 lines
		
	
	
	
		
			301 B
		
	
	
	
		
			Python
		
	
	
	
	
	
		
		
			
		
	
	
			14 lines
		
	
	
	
		
			301 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| 
								 | 
							
								from unittest import TestCase
							 | 
						||
| 
								 | 
							
								from cStringIO import StringIO
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								import json
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								class TestDump(TestCase):
							 | 
						||
| 
								 | 
							
								    def test_dump(self):
							 | 
						||
| 
								 | 
							
								        sio = StringIO()
							 | 
						||
| 
								 | 
							
								        json.dump({}, sio)
							 | 
						||
| 
								 | 
							
								        self.assertEquals(sio.getvalue(), '{}')
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    def test_dumps(self):
							 | 
						||
| 
								 | 
							
								        self.assertEquals(json.dumps({}), '{}')
							 |