We no longer need to support Python 2, so there's no point in this compatibility layer. Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com> (cherry picked from commit b34de57813187f1781aef733468c9745a144d9af)
		
			
				
	
	
		
			29 lines
		
	
	
		
			819 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			819 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| # -*- coding: utf-8 -*-
 | |
| 
 | |
| import unittest
 | |
| from io import StringIO
 | |
| 
 | |
| from pungi.wrappers.variants import VariantsXmlParser
 | |
| 
 | |
| VARIANTS_WITH_WHITESPACE = """
 | |
| <variants>
 | |
|   <variant id="Foo" name="Foo" type="variant">
 | |
|     <arches><arch>x86_64 </arch></arches>
 | |
|     <groups><group> core</group></groups>
 | |
|     <environments><environment> foo </environment></environments>
 | |
|   </variant>
 | |
| </variants>
 | |
| """
 | |
| 
 | |
| 
 | |
| class TestVariantsXmlParser(unittest.TestCase):
 | |
|     def test_whitespace_in_file(self):
 | |
|         input = StringIO(VARIANTS_WITH_WHITESPACE)
 | |
| 
 | |
|         with self.assertRaises(ValueError) as ctx:
 | |
|             VariantsXmlParser(input)
 | |
| 
 | |
|         self.assertIn("Tag arch on line 4", str(ctx.exception))
 | |
|         self.assertIn("Tag group on line 5", str(ctx.exception))
 | |
|         self.assertIn("Tag environment on line 6", str(ctx.exception))
 |