mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Drop _override_tempdir patch
and just set override_tempdir to False.
This commit is contained in:
@@ -707,7 +707,6 @@ class GalaxyAppConfiguration(BaseAppConfiguration, CommonConfigurationMixin):
|
||||
|
||||
def _override_tempdir(self, kwargs):
|
||||
if string_as_bool(kwargs.get("override_tempdir", "True")):
|
||||
raise Exception("How did we get here ?")
|
||||
tempfile.tempdir = self.new_file_path
|
||||
|
||||
def config_value_for_host(self, config_option, host):
|
||||
|
||||
@@ -6,14 +6,14 @@ from galaxy.config import BaseAppConfiguration
|
||||
|
||||
def test_object_store_store_by_set():
|
||||
# object_store_store_by set by admin
|
||||
appconfig = config.GalaxyAppConfiguration(object_store_store_by='id')
|
||||
appconfig = config.GalaxyAppConfiguration(object_store_store_by='id', override_tempdir=False)
|
||||
assert appconfig.object_store_store_by == 'id'
|
||||
|
||||
|
||||
def test_uuid_1():
|
||||
# object_store_store_by not set
|
||||
# file_path set by admin to `objects` (no need for the dir to exist)
|
||||
appconfig = config.GalaxyAppConfiguration(file_path='objects')
|
||||
appconfig = config.GalaxyAppConfiguration(file_path='objects', override_tempdir=False)
|
||||
|
||||
assert appconfig.object_store_store_by == 'uuid'
|
||||
|
||||
@@ -22,7 +22,7 @@ def test_uuid_2(monkeypatch):
|
||||
# object_store_store_by not set
|
||||
# file_path not set, `files` dir doesn't exist
|
||||
monkeypatch.setattr(BaseAppConfiguration, '_path_exists', lambda self, path: False)
|
||||
appconfig = config.GalaxyAppConfiguration()
|
||||
appconfig = config.GalaxyAppConfiguration(override_tempdir=False)
|
||||
|
||||
assert appconfig.object_store_store_by == 'uuid'
|
||||
|
||||
@@ -30,7 +30,7 @@ def test_uuid_2(monkeypatch):
|
||||
def test_id_1():
|
||||
# object_store_store_by not set
|
||||
# file_path set by admin to `not_objects` (no need for the dir to exist)
|
||||
appconfig = config.GalaxyAppConfiguration(file_path='not_objects')
|
||||
appconfig = config.GalaxyAppConfiguration(file_path='not_objects', override_tempdir=False)
|
||||
|
||||
assert appconfig.object_store_store_by == 'id'
|
||||
|
||||
@@ -39,6 +39,6 @@ def test_id_2(monkeypatch):
|
||||
# object_store_store_by not set
|
||||
# file_path not set, `files` dir exists
|
||||
monkeypatch.setattr(BaseAppConfiguration, '_path_exists', lambda self, path: True if os.path.basename(path) == 'files' else False)
|
||||
appconfig = config.GalaxyAppConfiguration()
|
||||
appconfig = config.GalaxyAppConfiguration(override_tempdir=False)
|
||||
|
||||
assert appconfig.object_store_store_by == 'id'
|
||||
|
||||
@@ -13,7 +13,7 @@ TestData = namedtuple('TestData', ('key', 'expected', 'loaded'))
|
||||
|
||||
@pytest.fixture(scope='module')
|
||||
def appconfig():
|
||||
return config.GalaxyAppConfiguration()
|
||||
return config.GalaxyAppConfiguration(override_tempdir=False)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -35,7 +35,7 @@ def test_common_base_config(appconfig):
|
||||
def test_base_config_if_running_from_source(monkeypatch, mock_config_file):
|
||||
# Simulated condition: running from source, config_file is None.
|
||||
monkeypatch.setattr(config, 'running_from_source', True)
|
||||
appconfig = config.GalaxyAppConfiguration()
|
||||
appconfig = config.GalaxyAppConfiguration(override_tempdir=False)
|
||||
assert not appconfig.config_file
|
||||
assert appconfig.config_dir == os.path.join(appconfig.root, 'config')
|
||||
assert appconfig.data_dir == os.path.join(appconfig.root, 'database')
|
||||
@@ -45,7 +45,7 @@ def test_base_config_if_running_from_source(monkeypatch, mock_config_file):
|
||||
def test_base_config_if_running_not_from_source(monkeypatch, mock_config_file):
|
||||
# Simulated condition: running not from source, config_file is None.
|
||||
monkeypatch.setattr(config, 'running_from_source', False)
|
||||
appconfig = config.GalaxyAppConfiguration()
|
||||
appconfig = config.GalaxyAppConfiguration(override_tempdir=False)
|
||||
assert not appconfig.config_file
|
||||
assert appconfig.config_dir == os.getcwd()
|
||||
assert appconfig.data_dir == os.path.join(appconfig.config_dir, 'data')
|
||||
|
||||
Reference in New Issue
Block a user