Skip to content

Commit

Permalink
Add attributes to the remote hub
Browse files Browse the repository at this point in the history
  • Loading branch information
betatim committed Apr 14, 2019
1 parent ca34094 commit 311f18d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions binderhub/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,14 @@ def _binderhub_config():
class RemoteBinderHub(object):
"""Mock class for the app fixture when Binder is remote
Only has a URL for the binder location.
Has a URL for the binder location,
_cfg for configuration of the hub
"""
url = None
_cfg = None

def __getattr__(self, name):
return getattr(self._cfg, name)


@pytest.fixture
Expand Down Expand Up @@ -169,9 +174,9 @@ def app(request, io_loop, _binderhub_config):
if not success:
raise last_error
app.url = BINDER_URL
app._cfg = _binderhub_config
return app


if hasattr(request, 'param') and request.param is True:
# load conf for auth test
cfg = PyFileConfigLoader(minikube_testing_auth_config).load_config()
Expand Down
1 change: 1 addition & 0 deletions binderhub/tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ async def test_versions_handler(app):
assert r.status_code == 200

data = r.json()
print(app._cfg)
assert data['builder'] == app.build_image
assert data['binderhub'] == binder_version

Expand Down

0 comments on commit 311f18d

Please sign in to comment.