def setUpClass(cls): for arg in sys.argv: if "liveserver" in arg: cls.server_url = "http://" + arg.split("=")[1] return StaticLiveServerTestCase.setUpClass() cls.server_url = cls.live_server_url
def setUpClass(cls): for arg in sys.argv: if 'liveserver' in arg: cls.server_url = 'http://' + arg.split('=')[1] return # StaticLiveServerTestCase.setUpClass() cls.server_url = cls.live_server_url
def setUpClass(cls): for arg in sys.argv: if "liveserver" in arg: cls.server_url = "http://" + arg.split("=")[1] return StaticLiveServerTestCase.setUpClass() cls.server_url = cls.live_server_url
def setUpClass(cls): for arg in sys.argv: if 'liveserver' in arg: cls.server_url = 'http://' + arg.split('=')[1] return # # in python2 we should pass current class name to the super StaticLiveServerTestCase.setUpClass() cls.server_url = cls.live_server_url
def handle(self, *args, **options): server = StaticLiveServerTestCase() server.setUpClass() server.setUp() crawler = Crawler() crawler.run(server.live_server_url) crawler.graph.save()
def start(self): super(DjangoServer, self).start() os.environ['DJANGO_LIVE_TEST_SERVER_ADDRESS'] = \ '{address}:{port}'.format(address=self.address, port=self.port) LiveServerTestCase.setUpClass() print("Django's builtin server is running at {address}:{port}". format(address=self.address, port=self.port))
def setUpClass(cls): for arg in sys.argv: if 'liveserver' in arg: cls.server_host = arg.split('=')[1] cls.server_url = 'http://' + cls.server_host cls.against_staging = True return StaticLiveServerTestCase.setUpClass() cls.against_staging = False cls.server_url = cls.live_server_url
def start(self): super(DjangoServer, self).start() os.environ['DJANGO_LIVE_TEST_SERVER_ADDRESS'] = \ '{address}:{port}'.format(address=self.address, port=self.port) LiveServerTestCase.setUpClass() print "Django's builtin server is running at {address}:{port}".format( address=self.address, port=self.port)
def setUpClass(cls): StaticLiveServerTestCase.setUpClass() # super(StaticLiveServerTestCase, cls).setUpClass() o1 = Organism(name="Organizm_testowy_1", id=1) o2 = Organism(name="Organizm_testowy_2", id=2) ch1 = Chromosome(organism=o1, number=1, length=40, id=1) ch2 = Chromosome(organism=o1, number=2, length=30, id=2) sc1 = Scaffold(chromosome=ch2, length=5, order=0, start=3, id=1) seq1 = Sequence(scaffold=sc1, sequence="AGTCA", id=1) sc2 = Scaffold(chromosome=ch2, length=7, order=1, start=11, id=2) seq2 = Sequence(scaffold=sc2, sequence="GTCAGTC", id=2) for obj in [o1, o2, ch1, ch2, sc1, seq1, sc2, seq2]: obj.save()
def start(self): super(DjangoServer, self).start() os.environ['DJANGO_LIVE_TEST_SERVER_ADDRESS'] = \ '{address}:{port}'.format(address=self.address, port=self.port) LiveServerTestCase.setUpClass() # now get the actual port that the test case was allocated self.port = LiveServerTestCase.server_thread.port world.django_url = self.url print "Django's builtin server is running at {address}:{port}".format( address=self.address, port=self.port)
def start(self): super(DjangoServer, self).start() os.environ['DJANGO_LIVE_TEST_SERVER_ADDRESS'] = \ '{address}:{port}'.format(address=self.address, port=self.port) LiveServerTestCase.setUpClass() # now get the actual port that the test case was allocated self.port = LiveServerTestCase.server_thread.port world.django_url = self.url print "Django's builtin server is running at {address}:{port}".format( address=self.address, port=self.port)
def setUpClass(cls): WithForm460ADataTest.setUpClass() StaticLiveServerTestCase.setUpClass() cls.username = '******' cls.passwd = 'admin' User.objects.create_superuser( username=cls.username, password=cls.passwd, email='') cls.candidate = Candidate.objects.all()[0] if not cls.candidate.first_name: cls.candidate.first_name = 'dummy' cls.candidate.save() cls.img_path = op.join(op.dirname(__file__), 'files', 'img.jpg')
def setUpClass(cls): WithForm460ADataTest.setUpClass() StaticLiveServerTestCase.setUpClass() cls.username = '******' cls.passwd = 'admin' User.objects.create_superuser(username=cls.username, password=cls.passwd, email='') cls.candidate = Candidate.objects.all()[0] if not cls.candidate.first_name: cls.candidate.first_name = 'dummy' cls.candidate.save() cls.img_path = op.join(op.dirname(__file__), 'files', 'img.jpg')
def run_tests(self, test_labels, extra_tests=None, **kwargs): # Disable logging below CRITICAL during tests. logging.disable(logging.CRITICAL) self.setup_test_environment() self.dbs = self.setup_databases() # Create a static server, it should start immediately. StaticLiveServerTestCase.setUpClass() # Set the environment variables used by Protractor. self.set_env_test_url() self.run_suite() return
class Server(object): def __init__(self): self._tc = StaticLiveServerTestCase('__init__') def start_server(self): self._requests_patcher = patch_requests() self._tc.setUpClass() logging.info("Server started: %s", self._tc.live_server_url) BuiltIn().set_suite_variable('${HOST}', self._tc.live_server_url) def stop_server(self): self._tc.tearDownClass() self._requests_patcher.stop() def server_command(self, name, *args, **kwargs): call_command(name, *args, **kwargs)
def run_tests(self, test_labels, extra_tests=None, **kwargs): # Disable logging below CRITICAL during tests. logging.disable(logging.CRITICAL) self.setup_test_environment() self.dbs = self.setup_databases() # Create a static server, it should start immediately. StaticLiveServerTestCase.setUpClass() # Set the environment variables used by Protractor. self.set_env_test_url() self.run_suite() return
class Server(object): def __init__(self): self._tc = StaticLiveServerTestCase('__init__') def start_server(self): self._requests_patcher = patch_requests() self._tc.setUpClass() logging.info("Server started: %s", self._tc.live_server_url) BuiltIn().set_suite_variable('${HOST}', self._tc.live_server_url) def stop_server(self): self._tc.tearDownClass() self._requests_patcher.stop() def server_command(self, name, *args, **kwargs): call_command(name, *args, **kwargs)
def setUpClass(cls): StaticLiveServerTestCase.setUpClass() cls.server_url = cls.live_server_url
def setUpClass(cls): StaticLiveServerTestCase.setUpClass() with connection.cursor() as cursor: cursor.execute("CREATE EXTENSION IF NOT EXISTS pg_trgm") cursor.execute("CREATE EXTENSION IF NOT EXISTS fuzzystrmatch")
def setUpClass(cls): StaticLiveServerTestCase.setUpClass() if USE_XVFB: # Start xvfb for Firefox cls.vdisplay = Display(visible=0, size=(1024, 768)) cls.vdisplay.start()