def setUpClass(cls): super(SphinxTestCase, cls).setUpClass() # If the settings aren't set or the executables don't exist # then skip Sphinx tests. if (not settings.SPHINX_SEARCHD or not os.path.exists(settings.SPHINX_SEARCHD) or not settings.SPHINX_INDEXER or not os.path.exists(settings.SPHINX_INDEXER) ): # This flag causes all the tests to get skipped. We do # this insteade of raising SkipTest here so that the test # numbers show up more correctly and it's less confusing # for whoever is running the tests. cls.skipme = True return os.environ['DJANGO_ENVIRONMENT'] = 'test' if os.path.exists(settings.TEST_SPHINX_PATH): shutil.rmtree(settings.TEST_SPHINX_PATH) os.makedirs(os.path.join(settings.TEST_SPHINX_PATH, 'data')) os.makedirs(os.path.join(settings.TEST_SPHINX_PATH, 'log')) os.makedirs(os.path.join(settings.TEST_SPHINX_PATH, 'etc')) reindex() start_sphinx() time.sleep(1)
def setUp(self): super(SphinxTestCase, self).setUp() from django.conf import settings settings.SITE_ID = settings.DESKTOP_SITE_ID if not SphinxTestCase.sphinx_is_running: if (not settings.SPHINX_SEARCHD or not settings.SPHINX_INDEXER): # pragma: no cover raise SkipTest() os.environ['DJANGO_ENVIRONMENT'] = 'test' if os.path.exists(settings.TEST_SPHINX_CATALOG_PATH): shutil.rmtree(settings.TEST_SPHINX_CATALOG_PATH) if os.path.exists(settings.TEST_SPHINX_LOG_PATH): shutil.rmtree(settings.TEST_SPHINX_LOG_PATH) os.makedirs(settings.TEST_SPHINX_LOG_PATH) os.makedirs(settings.TEST_SPHINX_CATALOG_PATH) reindex() start_sphinx() time.sleep(1) SphinxTestCase.sphinx_is_running = True
def setUpClass(cls): super(SphinxTestCase, cls).setUpClass() if not settings.SPHINX_SEARCHD or not settings.SPHINX_INDEXER: raise SkipTest() os.environ['DJANGO_ENVIRONMENT'] = 'test' if os.path.exists(settings.TEST_SPHINX_PATH): shutil.rmtree(settings.TEST_SPHINX_PATH) os.makedirs(os.path.join(settings.TEST_SPHINX_PATH, 'data')) os.makedirs(os.path.join(settings.TEST_SPHINX_PATH, 'log')) os.makedirs(os.path.join(settings.TEST_SPHINX_PATH, 'etc')) reindex() start_sphinx() time.sleep(1)
def setup_class(cls): super(SphinxTestCase, cls).setup_class() if not settings.SPHINX_SEARCHD or not settings.SPHINX_INDEXER: raise SkipTest() os.environ["DJANGO_ENVIRONMENT"] = "test" if os.path.exists(settings.TEST_SPHINX_PATH): shutil.rmtree(settings.TEST_SPHINX_PATH) os.makedirs(os.path.join(settings.TEST_SPHINX_PATH, "data")) os.makedirs(os.path.join(settings.TEST_SPHINX_PATH, "log")) os.makedirs(os.path.join(settings.TEST_SPHINX_PATH, "etc")) reindex() start_sphinx() time.sleep(1)
def setUp(self): if not SphinxTestCase.sphinx_is_running: if not settings.SPHINX_SEARCHD or not settings.SPHINX_INDEXER: raise SkipTest() os.environ['DJANGO_ENVIRONMENT'] = 'test' if os.path.exists('/tmp/data/sphinx'): shutil.rmtree('/tmp/data/sphinx') if os.path.exists('/tmp/log/searchd'): shutil.rmtree('/tmp/log/searchd') os.makedirs('/tmp/data/sphinx') os.makedirs('/tmp/log/searchd') reindex() start_sphinx() time.sleep(1) SphinxTestCase.sphinx_is_running = True
def setup_class(cls): super(SphinxTestCase, cls).setup_class() if not settings.SPHINX_SEARCHD or not settings.SPHINX_INDEXER: raise SkipTest() os.environ['DJANGO_ENVIRONMENT'] = 'test' if os.path.exists(settings.TEST_SPHINX_CATALOG_PATH): shutil.rmtree(settings.TEST_SPHINX_CATALOG_PATH) if os.path.exists(settings.TEST_SPHINX_LOG_PATH): shutil.rmtree(settings.TEST_SPHINX_LOG_PATH) os.makedirs(settings.TEST_SPHINX_LOG_PATH) os.makedirs(settings.TEST_SPHINX_CATALOG_PATH) reindex() start_sphinx()
def setUp(self): if not SphinxTestCase.sphinx_is_running: if not settings.SPHINX_SEARCHD or not settings.SPHINX_INDEXER: raise SkipTest() os.environ['DJANGO_ENVIRONMENT'] = 'test' if os.path.exists(settings.TEST_SPHINX_PATH): shutil.rmtree(settings.TEST_SPHINX_PATH) os.makedirs(os.path.join(settings.TEST_SPHINX_PATH, 'data')) os.makedirs(os.path.join(settings.TEST_SPHINX_PATH, 'log')) os.makedirs(os.path.join(settings.TEST_SPHINX_PATH, 'etc')) reindex() start_sphinx() time.sleep(1) SphinxTestCase.sphinx_is_running = True
def setUp(self): super(SphinxTestCase, self).setUp() if not SphinxTestCase.sphinx_is_running: if (not settings.SPHINX_SEARCHD or not settings.SPHINX_INDEXER): # pragma: no cover raise SkipTest() os.environ['DJANGO_ENVIRONMENT'] = 'test' if os.path.exists(settings.SPHINX_CATALOG_PATH): shutil.rmtree(settings.SPHINX_CATALOG_PATH) if os.path.exists(settings.SPHINX_DATA_PATH): shutil.rmtree(settings.SPHINX_DATA_PATH) os.makedirs('/tmp/data/sphinx') os.makedirs('/tmp/log/searchd') reindex() start_sphinx() time.sleep(1) SphinxTestCase.sphinx_is_running = True
def setUp(self): create_extra_tables() if not SphinxTestCase.sphinx_is_running: if not settings.SPHINX_SEARCHD or not settings.SPHINX_INDEXER: raise SkipTest() os.environ['DJANGO_ENVIRONMENT'] = 'test' if os.path.exists('/tmp/k'): shutil.rmtree('/tmp/k') os.makedirs('/tmp/k/data') os.makedirs('/tmp/k/log') os.makedirs('/tmp/k/etc') reindex() start_sphinx() time.sleep(1) SphinxTestCase.sphinx_is_running = True
def setUp(self): super(SphinxTestCase, self).setUp() if not SphinxTestCase.sphinx_is_running: if (not settings.SPHINX_SEARCHD or not settings.SPHINX_INDEXER): # pragma: no cover raise SkipTest() os.environ['DJANGO_ENVIRONMENT'] = 'test' if os.path.exists(settings.TEST_SPHINX_CATALOG_PATH): shutil.rmtree(settings.TEST_SPHINX_CATALOG_PATH) if os.path.exists(settings.TEST_SPHINX_LOG_PATH): shutil.rmtree(settings.TEST_SPHINX_LOG_PATH) os.makedirs(settings.TEST_SPHINX_CATALOG_PATH) os.makedirs(settings.TEST_SPHINX_LOG_PATH) reindex() start_sphinx() time.sleep(1) SphinxTestCase.sphinx_is_running = True
def setUp(self): super(SphinxTestCase, self).setUp() settings.SITE_ID = settings.DESKTOP_SITE_ID if not SphinxTestCase.sphinx_is_running: if not settings.SPHINX_SEARCHD or not settings.SPHINX_INDEXER: # pragma: no cover raise SkipTest() os.environ["DJANGO_ENVIRONMENT"] = "test" if os.path.exists(settings.TEST_SPHINX_CATALOG_PATH): shutil.rmtree(settings.TEST_SPHINX_CATALOG_PATH) if os.path.exists(settings.TEST_SPHINX_LOG_PATH): shutil.rmtree(settings.TEST_SPHINX_LOG_PATH) os.makedirs(settings.TEST_SPHINX_LOG_PATH) os.makedirs(settings.TEST_SPHINX_CATALOG_PATH) reindex() start_sphinx() SphinxTestCase.sphinx_is_running = True
def setUp(self): super(SphinxTestCase, self).setUp() if not SphinxTestCase.sphinx_is_running: if not settings.SPHINX_SEARCHD or not settings.SPHINX_INDEXER: # pragma: no cover raise SkipTest() os.environ["DJANGO_ENVIRONMENT"] = "test" # XXX: Path names need to be more clear. if os.path.exists(settings.SPHINX_CATALOG_PATH): shutil.rmtree(settings.SPHINX_CATALOG_PATH) if os.path.exists(settings.SPHINX_LOG_PATH): shutil.rmtree(settings.SPHINX_LOG_PATH) os.makedirs(settings.SPHINX_LOG_PATH) os.makedirs(settings.SPHINX_CATALOG_PATH) reindex() start_sphinx() time.sleep(1) SphinxTestCase.sphinx_is_running = True
def handle(self, *args, **options): reindex(options['rotate'])
def handle_noargs(self, **options): reindex(options['rotate'])