def do_set(self, s): l = s.split() if len(l)!=2: self.help_set(); return try : s = s.strip() param = s.split(); if ( param[0] == "company" ): scalex.company.set(self.companies[int(param[1])]); print 'set company ok' elif ( param[0] == "role" ): scalex.role.set(self.roles[int(param[1])]); print 'set role ok' elif param[0] == 'client_id': scalex.setClientId(param[1]) elif param[0] == 'client_secret': scalex.setClientSecret(param[1]) else : self.help_set(); except Exception,e: print "Unknown Error:" , e
''' scalex python SDK tests please add Oauth client_id and client_secret before test ''' import scalex holder = 'REPLACE ME' client_id = holder client_secret = holder assert client_id != holder or client_secret != holder, 'Please add client_id and client_secret in __init__.py before test' scalex.setClientId(client_id) scalex.setClientSecret(client_secret) coms = scalex.company.getCompanies() scalex.company.set(coms[0]) scalex.role.set('Admin') # set role as Admin