mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-04 14:30:30 +03:00
lint: support linting config files
This commit is contained in:
parent
3f35b0b361
commit
4511da68b9
3 changed files with 95 additions and 7 deletions
|
|
@ -2838,6 +2838,36 @@ class CommonTest(unittest.TestCase):
|
|||
with self.assertRaises(TypeError):
|
||||
fdroidserver.common.load_localized_config(CATEGORIES_CONFIG_NAME, 'repo')
|
||||
|
||||
def test_config_type_check_config_yml_dict(self):
|
||||
fdroidserver.common.config_type_check('config.yml', dict())
|
||||
|
||||
def test_config_type_check_config_yml_list(self):
|
||||
with self.assertRaises(TypeError):
|
||||
fdroidserver.common.config_type_check('config.yml', list())
|
||||
|
||||
def test_config_type_check_config_yml_set(self):
|
||||
with self.assertRaises(TypeError):
|
||||
fdroidserver.common.config_type_check('config.yml', set())
|
||||
|
||||
def test_config_type_check_config_yml_str(self):
|
||||
with self.assertRaises(TypeError):
|
||||
fdroidserver.common.config_type_check('config.yml', str())
|
||||
|
||||
def test_config_type_check_mirrors_list(self):
|
||||
fdroidserver.common.config_type_check('config/mirrors.yml', list())
|
||||
|
||||
def test_config_type_check_mirrors_dict(self):
|
||||
with self.assertRaises(TypeError):
|
||||
fdroidserver.common.config_type_check('config/mirrors.yml', dict())
|
||||
|
||||
def test_config_type_check_mirrors_set(self):
|
||||
with self.assertRaises(TypeError):
|
||||
fdroidserver.common.config_type_check('config/mirrors.yml', set())
|
||||
|
||||
def test_config_type_check_mirrors_str(self):
|
||||
with self.assertRaises(TypeError):
|
||||
fdroidserver.common.config_type_check('config/mirrors.yml', str())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
os.chdir(os.path.dirname(__file__))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue