Files
cellxgene/server/test/test_cxg_adaptor.py
Matt Weiden 5947306ca0 Add server plugin system (#1447)
* Add server plugin system

Plugins are optional modules loaded at runtime. Specification:
* Plugins are loaded from the server.plugins module (directory
  server/plugins)
* The import_plugins method is run as part of the initialization of the
  server module in __init__.py

* Add plugins to the EB build process

* Remove bit of dead code

* Respond to feedback from @bmccandless
2020-05-05 17:05:42 -07:00

20 lines
725 B
Python

import unittest
from server.common.data_locator import DataLocator
from server.data_cxg.cxg_adaptor import CxgAdaptor
from server.test import PROJECT_ROOT, app_config
from server.test.test_datasets.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"{PROJECT_ROOT}/server/test/test_datasets/{fixture}"
config = app_config(data_locator)
return CxgAdaptor(DataLocator(data_locator), config)