Exemple #1
0
 def set_sasurl(cls, loc='local', port=None):
     if not port:
         port = int(os.environ.get('LOCAL_MARVIN_PORT', 5000))
     istest = True if loc == 'utah' else False
     config.switchSasUrl(loc, test=istest, port=port)
     response = Interaction('api/general/getroutemap', request_type='get')
     config.urlmap = response.getRouteMap()
Exemple #2
0
 def test_sasurl_switch(self, sas, exp):
     public = sas == 'public'
     test = sas == 'test'
     if sas == 'testpub':
         public = test = True
     sas = 'utah' if sas != 'local' else sas
     config.switchSasUrl(sas, public=public, test=test)
     assert exp in config.sasurl
Exemple #3
0
def set_sasurl(loc='local', port=None):
    """Set the sasurl to local or test-utah, and regenerate the urlmap."""
    if not port:
        port = int(os.environ.get('LOCAL_MARVIN_PORT', 5000))
    istest = True if loc == 'utah' else False
    config.switchSasUrl(loc, test=istest, port=port)
    global URLMAP
    if not URLMAP:
        response = Interaction('/marvin/api/general/getroutemap', request_type='get', auth='netrc')
        config.urlmap = response.getRouteMap()
        URLMAP = config.urlmap
Exemple #4
0
    def test_sasurl_join(self, sas, exp):
        url = '/marvin/api/cubes/8485-1901/'
        public = sas == 'public'
        test = sas == 'test'
        if sas == 'testpub':
            public = test = True
        sas = 'utah' if sas != 'local' else sas
        config.switchSasUrl(sas, public=public, test=test)

        e = urlsplit(config.sasurl)
        t = urlsplit(url)
        final = urlunsplit(tuple(strjoin(*z) for z in zip(e, t)))
        assert exp == final
Exemple #5
0
 def test_sasurl_switch(self, sas, exp):
     public = sas == 'public'
     test = sas == 'test'
     sas = 'utah' if sas == 'public' or sas == 'test' else sas
     config.switchSasUrl(sas, public=public, test=test)
     assert exp in config.sasurl
Exemple #6
0
def set_sasurl(loc='local', port=5000):
    istest = True if loc == 'utah' else False
    config.switchSasUrl(loc, test=istest, port=port)
    response = Interaction('api/general/getroutemap', request_type='get')
    config.urlmap = response.getRouteMap()