Skip to content

Commit

Permalink
Inactivate all code that tries to set paths based on the installed pa…
Browse files Browse the repository at this point in the history
…th of microSALT via CONDA_PREFIX
  • Loading branch information
samuell committed Jul 4, 2024
1 parent 920a88e commit 68a7efd
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 33 deletions.
24 changes: 12 additions & 12 deletions tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
def unpack_db_json(filename):
testdata = os.path.abspath(os.path.join(pathlib.Path(__file__).parent.parent, 'tests/testdata/{}'.format(filename)))
#Check if release install exists
for entry in os.listdir(get_python_lib()):
if 'microSALT-' in entry:
testdata = os.path.abspath(os.path.join(os.path.expandvars('$CONDA_PREFIX'), 'testdata/{}'.format(filename)))
#for entry in os.listdir(get_python_lib()):
# if 'microSALT-' in entry:
# testdata = os.path.abspath(os.path.join(os.path.expandvars('$CONDA_PREFIX'), 'testdata/{}'.format(filename)))
with open(testdata) as json_file:
data = json.load(json_file)
return data
Expand Down Expand Up @@ -65,27 +65,27 @@ def runner():
def config():
config = os.path.abspath(os.path.join(pathlib.Path(__file__).parent.parent, 'configExample.json'))
#Check if release install exists
for entry in os.listdir(get_python_lib()):
if 'microSALT-' in entry:
config = os.path.abspath(os.path.join(os.path.expandvars('$CONDA_PREFIX'), 'testdata/configExample.json'))
#for entry in os.listdir(get_python_lib()):
# if 'microSALT-' in entry:
# config = os.path.abspath(os.path.join(os.path.expandvars('$CONDA_PREFIX'), 'testdata/configExample.json'))
return config

@pytest.fixture
def path_testdata():
testdata = os.path.abspath(os.path.join(pathlib.Path(__file__).parent.parent, 'tests/testdata/sampleinfo_samples.json'))
#Check if release install exists
for entry in os.listdir(get_python_lib()):
if 'microSALT-' in entry:
testdata = os.path.abspath(os.path.join(os.path.expandvars('$CONDA_PREFIX'), 'testdata/sampleinfo_samples.json'))
#for entry in os.listdir(get_python_lib()):
# if 'microSALT-' in entry:
# testdata = os.path.abspath(os.path.join(os.path.expandvars('$CONDA_PREFIX'), 'testdata/sampleinfo_samples.json'))
return testdata

@pytest.fixture
def path_testproject():
testproject = os.path.abspath(os.path.join(pathlib.Path(__file__).parent.parent, 'tests/testdata/AAA1234_2000.1.2_3.4.5'))
#Check if release install exists
for entry in os.listdir(get_python_lib()):
if 'microSALT-' in entry:
testproject = os.path.abspath(os.path.join(os.path.expandvars('$CONDA_PREFIX'), 'testproject/AAA1234_2000.1.2_3.4.5'))
#for entry in os.listdir(get_python_lib()):
# if 'microSALT-' in entry:
# testproject = os.path.abspath(os.path.join(os.path.expandvars('$CONDA_PREFIX'), 'testproject/AAA1234_2000.1.2_3.4.5'))
return testproject


Expand Down
6 changes: 3 additions & 3 deletions tests/test_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
def unpack_db_json(filename):
testdata = os.path.abspath(os.path.join(pathlib.Path(__file__).parent.parent, 'tests/testdata/{}'.format(filename)))
#Check if release install exists
for entry in os.listdir(get_python_lib()):
if 'microSALT-' in entry:
testdata = os.path.abspath(os.path.join(os.path.expandvars('$CONDA_PREFIX'), 'testdata/{}'.format(filename)))
#for entry in os.listdir(get_python_lib()):
# if 'microSALT-' in entry:
# testdata = os.path.abspath(os.path.join(os.path.expandvars('$CONDA_PREFIX'), 'testdata/{}'.format(filename)))
with open(testdata) as json_file:
data = json.load(json_file)
return data
Expand Down
6 changes: 3 additions & 3 deletions tests/test_jobcreator.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
def testdata():
testdata = os.path.abspath(os.path.join(pathlib.Path(__file__).parent.parent, 'tests/testdata/sampleinfo_samples.json'))
#Check if release install exists
for entry in os.listdir(get_python_lib()):
if 'microSALT-' in entry:
testdata = os.path.abspath(os.path.join(os.path.expandvars('$CONDA_PREFIX'), 'testdata/sampleinfo_samples.json'))
#for entry in os.listdir(get_python_lib()):
# if 'microSALT-' in entry:
# testdata = os.path.abspath(os.path.join(os.path.expandvars('$CONDA_PREFIX'), 'testdata/sampleinfo_samples.json'))
with open(testdata) as json_file:
data = json.load(json_file)
return data
Expand Down
6 changes: 3 additions & 3 deletions tests/test_reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
def unpack_db_json(filename):
testdata = os.path.abspath(os.path.join(pathlib.Path(__file__).parent.parent, 'tests/testdata/{}'.format(filename)))
#Check if release install exists
for entry in os.listdir(get_python_lib()):
if 'microSALT-' in entry:
testdata = os.path.abspath(os.path.join(os.path.expandvars('$CONDA_PREFIX'), 'testdata/{}'.format(filename)))
#for entry in os.listdir(get_python_lib()):
# if 'microSALT-' in entry:
# testdata = os.path.abspath(os.path.join(os.path.expandvars('$CONDA_PREFIX'), 'testdata/{}'.format(filename)))
with open(testdata) as json_file:
data = json.load(json_file)
return data
Expand Down
12 changes: 6 additions & 6 deletions tests/test_scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@
def testdata_prefix():
test_path = os.path.abspath(os.path.join(pathlib.Path(__file__).parent.parent, 'tests/testdata/'))
#Check if release install exists
for entry in os.listdir(get_python_lib()):
if 'microSALT-' in entry:
test_path = os.path.abspath(os.path.join(os.path.expandvars('$CONDA_PREFIX'), 'testdata/'))
#for entry in os.listdir(get_python_lib()):
# if 'microSALT-' in entry:
# test_path = os.path.abspath(os.path.join(os.path.expandvars('$CONDA_PREFIX'), 'testdata/'))
return test_path

@pytest.fixture
def testdata():
testdata = os.path.abspath(os.path.join(pathlib.Path(__file__).parent.parent, 'tests/testdata/sampleinfo_samples.json'))
#Check if release install exists
for entry in os.listdir(get_python_lib()):
if 'microSALT-' in entry:
testdata = os.path.abspath(os.path.join(os.path.expandvars('$CONDA_PREFIX'), 'testdata/sampleinfo_samples.json'))
#for entry in os.listdir(get_python_lib()):
# if 'microSALT-' in entry:
# testdata = os.path.abspath(os.path.join(os.path.expandvars('$CONDA_PREFIX'), 'testdata/sampleinfo_samples.json'))
with open(testdata) as json_file:
data = json.load(json_file)
return data
Expand Down
12 changes: 6 additions & 6 deletions tests/test_webserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
def unpack_db_json(filename):
testdata = os.path.abspath(os.path.join(pathlib.Path(__file__).parent.parent, 'tests/testdata/{}'.format(filename)))
#Check if release install exists
for entry in os.listdir(get_python_lib()):
if 'microSALT-' in entry:
testdata = os.path.abspath(os.path.join(os.path.expandvars('$CONDA_PREFIX'), 'testdata/{}'.format(filename)))
#for entry in os.listdir(get_python_lib()):
# if 'microSALT-' in entry:
# testdata = os.path.abspath(os.path.join(os.path.expandvars('$CONDA_PREFIX'), 'testdata/{}'.format(filename)))
with open(testdata) as json_file:
data = json.load(json_file)
return data
Expand All @@ -51,9 +51,9 @@ def mock_db():
def testdata():
testdata = os.path.abspath(os.path.join(pathlib.Path(__file__).parent.parent, 'tests/testdata/sampleinfo_samples.json'))
#Check if release install exists
for entry in os.listdir(get_python_lib()):
if 'microSALT-' in entry:
testdata = os.path.abspath(os.path.join(os.path.expandvars('$CONDA_PREFIX'), 'testdata/sampleinfo_samples.json'))
#for entry in os.listdir(get_python_lib()):
# if 'microSALT-' in entry:
# testdata = os.path.abspath(os.path.join(os.path.expandvars('$CONDA_PREFIX'), 'testdata/sampleinfo_samples.json'))
with open(testdata) as json_file:
data = json.load(json_file)
return data
Expand Down

0 comments on commit 68a7efd

Please sign in to comment.