diff --git a/docs/source/conf.py b/docs/source/conf.py index a3a3646fdec3cfa425d49b626b7c0cebb4edfc7b..db4101bf781340c8369af080e073ec7d26c43e8a 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -25,7 +25,7 @@ import sys sys.path.insert(0, os.path.abspath( os.path.join( os.path.dirname(__file__), - '..', '..', 'inventory_provider'))) + '..', '..', 'brian_dashboard_manager'))) class RenderAsJSON(Directive): @@ -37,14 +37,14 @@ class RenderAsJSON(Directive): module_path, member_name = self.arguments[0].rsplit('.', 1) member_data = getattr(import_module(module_path), member_name) - code = json.dumps(member_data, indent=2) + code = json.dumps(member_data, indent=2, ensure_ascii=False) literal = nodes.literal_block(code, code) literal['language'] = 'json' return [ - addnodes.desc_name(text=member_name), - addnodes.desc_content('', literal) + addnodes.desc_name(text=member_name), + addnodes.desc_content('', literal) ] @@ -68,9 +68,9 @@ release = '0.0' # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ - 'sphinx_rtd_theme', - 'sphinx.ext.autodoc', - 'sphinx.ext.coverage' + 'sphinx_rtd_theme', + 'sphinx.ext.autodoc', + 'sphinx.ext.coverage' ] # Add any paths that contain templates here, relative to this directory. diff --git a/docs/source/configuration.rst b/docs/source/configuration.rst index 5f35ebc14879888fe5692152ae72176b34f0f25a..b919f88fa4542d2c380ff304c1d210f956d24060 100644 --- a/docs/source/configuration.rst +++ b/docs/source/configuration.rst @@ -12,6 +12,10 @@ similarly to `config.json.example`, and the name of this file should be stored in the environment variable `CONFIG_FILENAME` when running the service. +Config +--------- +.. automodule:: brian_dashboard_manager.config + Running this module --------------------- @@ -29,4 +33,4 @@ This module has been tested in the following execution environments: * As a `gunicorn` wsgi service. * Details of `gunicorn` configuration can be found in the - brian_dashboard_manager Puppet repository. \ No newline at end of file + brian_dashboard_manager Puppet repository. diff --git a/docs/source/index.rst b/docs/source/index.rst index 97444a54aef7962b68d0cc7ec16d4ccf7d46fad0..287c77d9a3e1669af49747bd08f1267251ed1dba 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -4,8 +4,8 @@ contain the root `toctree` directive. -Inventory Provider -================== +BRIAN Dashboard Manager +======================= The BRIAN Dashboard Manager is used provision Organizations and Dashboards in Grafana for BRIAN. diff --git a/test/test_update.py b/test/test_update.py index 0c77cf7c6f8c109945ceb4c44f4179bc2c4ba44b..68c3d10124e61f58e6b68895c27beebd701b74b6 100644 --- a/test/test_update.py +++ b/test/test_update.py @@ -2,7 +2,7 @@ import responses import json from brian_dashboard_manager.templating.nren_access import get_nrens from brian_dashboard_manager.grafana.provision import provision_folder, \ - generate_all_nrens + generate_all_nrens, provision from brian_dashboard_manager.grafana.provision import is_re_customer, \ is_cls, is_ias_customer, is_ias_private, is_ias_public, is_ias_upstream, \ is_lag_backbone, is_phy_upstream, is_re_peer, is_gcs, \ @@ -236,7 +236,8 @@ def test_provision_folder(data_config, mocker): for dashboard in dashboards: provision_folder(None, 'testfolder', dashboards[dashboard], - TEST_INTERFACES, 'testdatasource') + TEST_INTERFACES, + 'testdatasource', ['CLS TESTDASHBOARD']) def test_provision_nrens(data_config, mocker): @@ -316,6 +317,11 @@ def test_provision(data_config, mocker, client): url=f"{data_config['inventory_provider']}/poller/interfaces", callback=get_callback) + responses.add_callback( + method=responses.GET, + url=f"{data_config['inventory_provider']}/data/interfaces", + callback=get_callback) + def folder_get(request): return 200, {}, json.dumps([]) @@ -416,7 +422,4 @@ def test_provision(data_config, mocker, client): 'brian_dashboard_manager.grafana.provision.delete_api_token') # we dont care about this, tested separately _mocked_delete_api_token.return_value = None - response = client.get('/update/', headers=DEFAULT_REQUEST_HEADERS) - assert response.status_code == 200 - data = json.loads(response.data.decode('utf-8'))['data'] - assert data is not None # == EXISTING_ORGS + [PROVISIONED_ORGANIZATION] + provision(data_config)