Пример #1
0
    def setUpClass(cls):
        cls.root = tempfile.mkdtemp()
        os.environ['VIXEN_ROOT'] = os.path.join(cls.root, 'vixen')
        make_data(cls.root)
        ui = make_ui()
        port = 9876
        ioloop = main(dev=True, port=port, test=True, **ui.get_context())
        t = Thread(target=ioloop.start)
        t.setDaemon(True)
        t.start()

        driver = os.environ.get('DRIVER', 'firefox')

        if driver == 'firefox':
            browser = webdriver.Firefox()
        elif driver == 'chrome':
            browser = webdriver.Chrome()

        browser.implicitly_wait(20)
        browser.get('http://localhost:%d' % port)
        time.sleep(2)
        cls.driver = driver
        cls.browser = browser
        cls.ui = ui
        cls.thread = t
Пример #2
0
 def setUp(self):
     self._temp = tempfile.mkdtemp()
     self.root = os.path.join(self._temp, 'test')
     self.root1 = os.path.join(self._temp, 'test1')
     make_data(self._temp)
Пример #3
0
 def setUp(self):
     self._temp = tempfile.mkdtemp()
     self.root = join(self._temp, 'test')
     make_data(self._temp)