Пример #1
0
 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
Пример #2
0
 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
Пример #3
0
 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
Пример #4
0
 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()
Пример #6
0
        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))
Пример #7
0
	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
Пример #8
0
        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)
Пример #9
0
 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()
Пример #10
0
        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)
Пример #11
0
        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)
Пример #12
0
    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')
Пример #13
0
    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')
Пример #14
0
    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
Пример #15
0
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)
Пример #16
0
    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
Пример #17
0
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)
Пример #18
0
 def setUpClass(cls):
     StaticLiveServerTestCase.setUpClass()
     cls.server_url = cls.live_server_url
Пример #19
0
 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")
Пример #20
0
 def setUpClass(cls):
     StaticLiveServerTestCase.setUpClass()
     if USE_XVFB:
         # Start xvfb for Firefox
         cls.vdisplay = Display(visible=0, size=(1024, 768))
         cls.vdisplay.start()