#===============================================================================
# # 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'])
Esempio n. 2
0
 def test_load_resources_with_wildcards_module_names(self):
     load_resources(['testapi.resources.*.resource'])
Esempio n. 3
0
 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
Esempio n. 4
0
 def test_load_resources(self):
     load_resources(['testapi.resources.users.resource'])
Esempio n. 5
0
 def test_load_resources_with_nonexistent_module_names(self):
     with pytest.raises(ImportError):
         load_resources(['testapi.resources.counts.resource'])
Esempio n. 6
0
 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
Esempio n. 7
0
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"
Esempio n. 8
0
 def test_load_resources_with_wildcards_module_names(self):
     load_resources(['testapi.resources.*.resource'])
Esempio n. 9
0
 def test_load_resources_with_nonexistent_module_names(self):
     with pytest.raises(ImportError):
         load_resources(['testapi.resources.counts.resource'])
Esempio n. 10
0
 def test_load_resources(self):
     load_resources(['testapi.resources.users.resource'])
Esempio n. 11
0
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'])
Esempio n. 12
0
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'])