mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-08-16 19:30:09 +02:00
config: test cases for serverwebroot: with string and list
This commit is contained in:
parent
5983962107
commit
3f50372d8d
@ -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…
Reference in New Issue
Block a user