mirror of
				https://github.com/msgpack/msgpack-python.git
				synced 2025-10-31 17:40:54 +00:00 
			
		
		
		
	python: Add test for unpacking buffer object.
This commit is contained in:
		
							parent
							
								
									8d3ca93be9
								
							
						
					
					
						commit
						3903979a84
					
				
					 1 changed files with 16 additions and 0 deletions
				
			
		
							
								
								
									
										16
									
								
								test/test_buffer.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								test/test_buffer.py
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,16 @@ | |||
| #!/usr/bin/env python | ||||
| # coding: utf-8 | ||||
| 
 | ||||
| from nose import main | ||||
| from nose.tools import * | ||||
| from msgpack import packb, unpackb | ||||
| 
 | ||||
| def test_unpack_buffer(): | ||||
|     from array import array | ||||
|     buf = array('b') | ||||
|     buf.fromstring(packb(['foo', 'bar'])) | ||||
|     obj = unpackb(buf) | ||||
|     assert_equal(['foo', 'bar'], obj) | ||||
| 
 | ||||
| if __name__ == '__main__': | ||||
|     main() | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 INADA Naoki
						INADA Naoki