restage 0.7.0__tar.gz → 0.7.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {restage-0.7.0/src/restage.egg-info → restage-0.7.2}/PKG-INFO +1 -1
- {restage-0.7.0 → restage-0.7.2}/src/restage/cache.py +10 -2
- {restage-0.7.0 → restage-0.7.2}/src/restage/mcpl.py +0 -1
- {restage-0.7.0 → restage-0.7.2/src/restage.egg-info}/PKG-INFO +1 -1
- {restage-0.7.0 → restage-0.7.2}/test/test_env_vars.py +24 -0
- {restage-0.7.0 → restage-0.7.2}/.github/workflows/pip.yml +0 -0
- {restage-0.7.0 → restage-0.7.2}/.github/workflows/wheels.yml +0 -0
- {restage-0.7.0 → restage-0.7.2}/.gitignore +0 -0
- {restage-0.7.0 → restage-0.7.2}/README.md +0 -0
- {restage-0.7.0 → restage-0.7.2}/pyproject.toml +0 -0
- {restage-0.7.0 → restage-0.7.2}/setup.cfg +0 -0
- {restage-0.7.0 → restage-0.7.2}/src/restage/__init__.py +0 -0
- {restage-0.7.0 → restage-0.7.2}/src/restage/bifrost_choppers.py +0 -0
- {restage-0.7.0 → restage-0.7.2}/src/restage/config/__init__.py +0 -0
- {restage-0.7.0 → restage-0.7.2}/src/restage/config/default.yaml +0 -0
- {restage-0.7.0 → restage-0.7.2}/src/restage/cspec_choppers.py +0 -0
- {restage-0.7.0 → restage-0.7.2}/src/restage/database.py +0 -0
- {restage-0.7.0 → restage-0.7.2}/src/restage/emulate.py +0 -0
- {restage-0.7.0 → restage-0.7.2}/src/restage/energy.py +0 -0
- {restage-0.7.0 → restage-0.7.2}/src/restage/instr.py +0 -0
- {restage-0.7.0 → restage-0.7.2}/src/restage/range.py +0 -0
- {restage-0.7.0 → restage-0.7.2}/src/restage/run.py +0 -0
- {restage-0.7.0 → restage-0.7.2}/src/restage/scan.py +0 -0
- {restage-0.7.0 → restage-0.7.2}/src/restage/splitrun.py +0 -0
- {restage-0.7.0 → restage-0.7.2}/src/restage/tables.py +0 -0
- {restage-0.7.0 → restage-0.7.2}/src/restage.egg-info/SOURCES.txt +0 -0
- {restage-0.7.0 → restage-0.7.2}/src/restage.egg-info/dependency_links.txt +0 -0
- {restage-0.7.0 → restage-0.7.2}/src/restage.egg-info/entry_points.txt +0 -0
- {restage-0.7.0 → restage-0.7.2}/src/restage.egg-info/requires.txt +0 -0
- {restage-0.7.0 → restage-0.7.2}/src/restage.egg-info/top_level.txt +0 -0
- {restage-0.7.0 → restage-0.7.2}/test/test_cache.py +0 -0
- {restage-0.7.0 → restage-0.7.2}/test/test_cache_ro.py +0 -0
- {restage-0.7.0 → restage-0.7.2}/test/test_database.py +0 -0
- {restage-0.7.0 → restage-0.7.2}/test/test_energy.py +0 -0
- {restage-0.7.0 → restage-0.7.2}/test/test_range.py +0 -0
- {restage-0.7.0 → restage-0.7.2}/test/test_scan.py +0 -0
- {restage-0.7.0 → restage-0.7.2}/test/test_single.py +0 -0
|
@@ -26,10 +26,18 @@ class FileSystem:
|
|
|
26
26
|
path.mkdir(parents=True)
|
|
27
27
|
db_write = Database(path / named)
|
|
28
28
|
root = path
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
|
|
30
|
+
def exists_not_root(roc):
|
|
31
|
+
roc = Path(roc)
|
|
32
|
+
if not roc.exists() or not (roc / named).exists():
|
|
33
|
+
return False
|
|
34
|
+
return root.resolve() != roc.resolve() if root is not None else True
|
|
35
|
+
|
|
36
|
+
if config['fixed'].exists() and config['fixed'].get() is not None:
|
|
37
|
+
more = [Path(c) for c in config['fixed'].as_str_seq() if exists_not_root(c)]
|
|
31
38
|
for m in more:
|
|
32
39
|
db_fixed.append(Database(m / named, readonly=True))
|
|
40
|
+
|
|
33
41
|
if db_write is not None and db_write.readonly:
|
|
34
42
|
raise ValueError("Specified writable database location is readonly")
|
|
35
43
|
if db_write is None:
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import os
|
|
1
2
|
from unittest import TestCase
|
|
2
3
|
from unittest.mock import patch
|
|
3
4
|
from importlib import reload
|
|
@@ -31,6 +32,29 @@ class SettingsTests(TestCase):
|
|
|
31
32
|
self.assertEqual(more[1],'/tmp/b')
|
|
32
33
|
self.assertEqual(more[2],'/tmp/c')
|
|
33
34
|
|
|
35
|
+
@patch.dict(os.environ, {"RESTAGE_FIXED": ''})
|
|
36
|
+
def test_restage_none_fixed_config(self):
|
|
37
|
+
reload(restage.config)
|
|
38
|
+
from restage.config import config
|
|
39
|
+
from confuse.exceptions import ConfigTypeError
|
|
40
|
+
self.assertTrue(config['fixed'].exists())
|
|
41
|
+
self.assertTrue(config['fixed'].get() is None)
|
|
42
|
+
self.assertRaises(ConfigTypeError, config['fixed'].as_str_seq)
|
|
43
|
+
|
|
44
|
+
def test_missing_database_in_fixed_config(self):
|
|
45
|
+
from tempfile import TemporaryDirectory
|
|
46
|
+
from pathlib import Path
|
|
47
|
+
with TemporaryDirectory() as tmpdir:
|
|
48
|
+
self.assertFalse((Path(tmpdir) / 'database.db').exists())
|
|
49
|
+
with patch.dict(os.environ, {'RESTAGE_FIXED': tmpdir}):
|
|
50
|
+
reload(restage.config)
|
|
51
|
+
from restage.config import config
|
|
52
|
+
self.assertTrue(config['fixed'].exists())
|
|
53
|
+
self.assertEqual(config['fixed'].as_str(), tmpdir)
|
|
54
|
+
from restage.cache import FILESYSTEM
|
|
55
|
+
self.assertEqual(len(FILESYSTEM.db_fixed), 0)
|
|
56
|
+
|
|
57
|
+
|
|
34
58
|
def test_restage_standard_config(self):
|
|
35
59
|
from os import environ
|
|
36
60
|
reload(restage.config)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|