mirror of
				https://github.com/f-droid/fdroidserver.git
				synced 2025-11-04 06:30:27 +03:00 
			
		
		
		
	config: test cases for serverwebroot: with string and list
This commit is contained in:
		
							parent
							
								
									5983962107
								
							
						
					
					
						commit
						3f50372d8d
					
				
					 1 changed files with 16 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -2868,6 +2868,22 @@ class CommonTest(unittest.TestCase):
 | 
			
		|||
        with self.assertRaises(TypeError):
 | 
			
		||||
            fdroidserver.common.config_type_check('config/mirrors.yml', str())
 | 
			
		||||
 | 
			
		||||
    def test_config_serverwebroot_str(self):
 | 
			
		||||
        os.chdir(self.testdir)
 | 
			
		||||
        Path('config.yml').write_text("""serverwebroot: 'foo@example.com:/var/www'""")
 | 
			
		||||
        self.assertEqual(
 | 
			
		||||
            ['foo@example.com:/var/www/'],
 | 
			
		||||
            fdroidserver.common.read_config()['serverwebroot'],
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
    def test_config_serverwebroot_list(self):
 | 
			
		||||
        os.chdir(self.testdir)
 | 
			
		||||
        Path('config.yml').write_text("""serverwebroot:\n  - foo@example.com:/var/www""")
 | 
			
		||||
        self.assertEqual(
 | 
			
		||||
            ['foo@example.com:/var/www/'],
 | 
			
		||||
            fdroidserver.common.read_config()['serverwebroot'],
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
if __name__ == "__main__":
 | 
			
		||||
    os.chdir(os.path.dirname(__file__))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue