Refactor czi_hosted and server into backend directory, pull common code into backend/common, refactor tests (#2102)

* move local_server -> backend/server server-> backend/czi_hosted, pull common code into backend/common update imports, tests and make commands
This commit is contained in:
Madison Dunitz
2021-03-26 00:27:07 -05:00
committed by GitHub
parent e6e358ddc8
commit 78c9d24ed4
425 changed files with 734 additions and 5317 deletions
@@ -0,0 +1,20 @@
import unittest
from backend.common.utils.data_locator import DataLocator
from backend.czi_hosted.data_cxg.cxg_adaptor import CxgAdaptor
from backend.test.test_czi_hosted.unit import app_config
from backend.test import FIXTURES_ROOT
from backend.test.fixtures.fixtures import pbmc3k_colors
class TestCxgAdaptor(unittest.TestCase):
def test_get_colors(self):
data = self.get_data("pbmc3k.cxg")
self.assertDictEqual(data.get_colors(), pbmc3k_colors)
data = self.get_data("pbmc3k_v0.cxg")
self.assertDictEqual(data.get_colors(), dict())
def get_data(self, fixture):
data_locator = f"{FIXTURES_ROOT}/{fixture}"
config = app_config(data_locator)
return CxgAdaptor(DataLocator(data_locator), config)