#=============================================================================== # # Contributors: # Prabhat Bhatt # Apoorva Saxena #=============================================================================== from restart.api import RESTArt from restart.utils import load_resources import threading import socket from thread import * import time # def startRestAPI(): # vote = '' id = 0 name = 'Fep_2_Server' api = RESTArt() # Load all resources load_resources(['resource_fep2']) load_resources(['resource1_fep2']) load_resources(['resource2_fep2'])
def test_load_resources_with_wildcards_module_names(self): load_resources(['testapi.resources.*.resource'])
def test_load_resources_with_nonexistent_wildcards_module_names(self): module_name = 'testapi.resources.users.*.resource' with pytest.raises(ImportError) as exc: load_resources([module_name]) expected_exc_msg = 'No module found with wildcards %r' % module_name assert str(exc.value) == expected_exc_msg
def test_load_resources(self): load_resources(['testapi.resources.users.resource'])
def test_load_resources_with_nonexistent_module_names(self): with pytest.raises(ImportError): load_resources(['testapi.resources.counts.resource'])
import time import random # def startRestAPI(): # vote = '' id = 0 name = 'BackEnd' #---new var = 0 api = RESTArt() # Load all resources load_resources(['resource']) load_resources(['resource1']) load_resources(['resource2']) load_resources(['resource3']) load_resources(['resource4']) load_resources(['resource5']) load_resources(['resource6']) load_resources(['resource7']) def Backend_socket(num1): global var bid = random.randint(1, 10) name = 'Backend' vote = name + ':' + str(bid) + ',' print "Starting Backend_socket on 5050"
from __future__ import absolute_import from restart.api import RESTArt from restart.utils import load_resources api = RESTArt() # Load all resources load_resources(['blog.resources.*.resource'])