genesets route for local server (#2079)

* first cut at GET /genesets route

* update existing tests to match code changes

* more GET /genesets and initial tests

* add missing test fixture

* geneset validation accepts OTA format

* genesets route: better error handling, more tests

* lint
This commit is contained in:
Bruce Martin
2021-02-26 17:53:07 -08:00
committed by GitHub
parent 09466a5c32
commit f3a3820ffa
18 changed files with 813 additions and 82 deletions
@@ -92,8 +92,10 @@ class ConfigTests(unittest.TestCase):
hosted_file_directory="null",
local_file_csv_directory="null",
local_file_csv_file="null",
local_file_csv_genesets_file="null",
ontology_enabled="false",
obo_location="null",
genesets_readonly="false",
embedding_names=[],
enable_reembedding="false",
enable_difexp="true",
@@ -142,8 +144,10 @@ class ConfigTests(unittest.TestCase):
hosted_file_directory=hosted_file_directory,
local_file_csv_directory=local_file_csv_directory,
local_file_csv_file=local_file_csv_file,
local_file_csv_genesets_file=local_file_csv_genesets_file,
ontology_enabled=ontology_enabled,
obo_location=obo_location,
genesets_readonly=genesets_readonly,
embedding_names=embedding_names,
enable_reembedding=enable_reembedding,
enable_difexp=enable_difexp,
@@ -178,8 +182,10 @@ class ConfigTests(unittest.TestCase):
hosted_file_directory="null",
local_file_csv_directory="null",
local_file_csv_file="null",
local_file_csv_genesets_file="null",
ontology_enabled="false",
obo_location="null",
genesets_readonly="false",
embedding_names=[],
enable_reembedding="false",
enable_difexp="true",
@@ -47,7 +47,7 @@ class TestDatasetConfig(ConfigTests):
mock_check_attrs.side_effect = BaseConfig.validate_correct_type_of_configuration_attribute()
self.dataset_config.complete_config(self.context)
self.assertIsNotNone(self.config.server_config.data_adaptor)
self.assertEqual(mock_check_attrs.call_count, 17)
self.assertEqual(mock_check_attrs.call_count, 19)
def test_app_sets_script_vars(self):
config = self.get_config(scripts=["path/to/script"])
@@ -102,7 +102,7 @@ class TestDatasetConfig(ConfigTests):
enable_users_annotations="true", authentication_enable="true", annotation_type="local_file_csv"
)
config.server_config.complete_config(self.context)
config.dataset_config.handle_local_file_csv_annotations()
config.dataset_config.handle_local_file_csv_annotations(self.context)
self.assertIsInstance(config.dataset_config.user_annotations, AnnotationsLocalFile)
cwd = os.getcwd()
self.assertEqual(config.dataset_config.user_annotations._get_output_dir(), cwd)