mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-28 11:38:11 +08:00
config refactor (#1854)
* split out config * add tests for base and app config, refactor client config out of app config * refactor default config retrieval * create config test class and helper functions * move default_config into server to fix import issue
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import filecmp
|
||||
import os
|
||||
import shutil
|
||||
import unittest
|
||||
|
||||
import yaml
|
||||
|
||||
from server.default_config import default_config
|
||||
from server.test import FIXTURES_ROOT
|
||||
|
||||
|
||||
class CLIPLaunchTests(unittest.TestCase):
|
||||
tmp_dir = os.path.join(FIXTURES_ROOT, "dump_configs")
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls) -> None:
|
||||
os.mkdir(cls.tmp_dir)
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls) -> None:
|
||||
shutil.rmtree(cls.tmp_dir)
|
||||
|
||||
|
||||
def test_dump_default_config(self):
|
||||
os.system(f"cellxgene launch --dump-default-config > {self.tmp_dir}/test_config_dump.txt")
|
||||
with open(f"{self.tmp_dir}/expected_config_dump.txt", "w") as expected_config:
|
||||
expected_config.write(yaml.dump(default_config))
|
||||
filecmp.cmp(f"{self.tmp_dir}/expected_config_dump.txt", f"{self.tmp_dir}/test_config_dump.txt")
|
||||
Reference in New Issue
Block a user