mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-01 14:38:13 +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:
@@ -2,7 +2,7 @@ import unittest
|
||||
|
||||
import requests
|
||||
|
||||
from server.common.app_config import AppConfig
|
||||
from server.common.config.app_config import AppConfig
|
||||
from server.test import FIXTURES_ROOT, test_server
|
||||
|
||||
|
||||
@@ -12,9 +12,7 @@ class AuthTest(unittest.TestCase):
|
||||
|
||||
def test_auth_none(self):
|
||||
c = AppConfig()
|
||||
c.update_server_config(
|
||||
authentication__type=None, multi_dataset__dataroot=self.dataset_dataroot
|
||||
)
|
||||
c.update_server_config(authentication__type=None, multi_dataset__dataroot=self.dataset_dataroot)
|
||||
c.update_default_dataset_config(user_annotations__enable=False)
|
||||
|
||||
c.complete_config()
|
||||
@@ -28,9 +26,7 @@ class AuthTest(unittest.TestCase):
|
||||
|
||||
def test_auth_session(self):
|
||||
c = AppConfig()
|
||||
c.update_server_config(
|
||||
authentication__type="session", multi_dataset__dataroot=self.dataset_dataroot
|
||||
)
|
||||
c.update_server_config(authentication__type="session", multi_dataset__dataroot=self.dataset_dataroot)
|
||||
c.update_default_dataset_config(user_annotations__enable=True)
|
||||
c.complete_config()
|
||||
|
||||
@@ -107,8 +103,8 @@ class AuthTest(unittest.TestCase):
|
||||
def test_auth_test_single(self):
|
||||
c = AppConfig()
|
||||
c.update_server_config(
|
||||
authentication__type="test",
|
||||
single_dataset__datapath=f"{self.dataset_dataroot}/pbmc3k.cxg")
|
||||
authentication__type="test", single_dataset__datapath=f"{self.dataset_dataroot}/pbmc3k.cxg"
|
||||
)
|
||||
|
||||
c.complete_config()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user