1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-04 14:30:11 +01:00

config: test cases for serverwebroot: with string and list

This commit is contained in:
Hans-Christoph Steiner 2024-01-22 21:46:56 +01:00
parent 5983962107
commit 3f50372d8d

View File

@ -2868,6 +2868,22 @@ class CommonTest(unittest.TestCase):
with self.assertRaises(TypeError): with self.assertRaises(TypeError):
fdroidserver.common.config_type_check('config/mirrors.yml', str()) 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__": if __name__ == "__main__":
os.chdir(os.path.dirname(__file__)) os.chdir(os.path.dirname(__file__))