def test_login_fail(self, monkeypatch): monkeypatch.setattr(config, 'token', None) assert config.token is None monkeypatch.setattr(config, 'access', 'public') with pytest.raises(AssertionError) as cm: config.login() assert 'You must have collaboration access to login.' in str(cm.value)
def set_the_config(release): """Set config release without parametrizing. Using ``set_release`` combined with ``galaxy`` double parametrizes!""" config.access = 'collab' config.setRelease(release) set_sasurl(loc='local') config.login() config._traceback = None
def init_web(monkeypatch, monkeyauth, set_config): config.forceDbOn() config.login() # monkeypath the render templating to nothing def _empty_render(template, context, app): template_rendered.send(app, template=template, context=context) return "" monkeypatch.setattr(templating, '_render', _empty_render)
def test_bad_login(self): config.access = 'public' with pytest.raises(AssertionError) as cm: config.login() assert 'You must have collaboration access to login.' in str(cm.value)
def test_login(self, monkeypatch): monkeypatch.setattr(config, 'token', None) assert config.token is None config.login() assert config.token is not None
def init_api(monkeyauth, set_config, urlmap): config.forceDbOn() config.login()
def prepare_marvin(): from marvin import config config.access = "collab" config.mode = "auto" config.setRelease("MPL-10") config.login()
import math from bresenham import bresenham import numpy.ma as ma from scipy.optimize import curve_fit from scipy import asarray as ar, exp import cv2 get_ipython().run_line_magic('matplotlib', 'inline') # Make sure you have collaborator access - if not go set it up following these instructinos: # https://sdss-marvin.readthedocs.io/en/stable/installation.html config.access = 'collab' # Choose the data release you would like to use (could also use MPL) config.setRelease('MPL-8') print(config.access) # I had to re-log in when I first ran this code: config.login(refresh=True) print(config.token) #Strong bars: #8444-12703 #8984-12704 #8135-6103 #9196-12701 #9886-12705 #Weak bars (some of these might not have enough signal to do anything with their velocity fields. Let me know if so and I’ll find some others): #8987-12702 #8567-12703 #8318-12704 #8988-12705 #8332-12701