Bring back data_dir attribute for tests
This commit is contained in:
parent
ae9fc14795
commit
4ba1296d06
@ -32,6 +32,8 @@ class CB:
|
|||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
config,
|
config,
|
||||||
|
*,
|
||||||
|
data_dir=None,
|
||||||
no_tests=False,
|
no_tests=False,
|
||||||
create_remote_dirs=False
|
create_remote_dirs=False
|
||||||
) -> None:
|
) -> None:
|
||||||
@ -41,9 +43,12 @@ class CB:
|
|||||||
self.no_tests = no_tests
|
self.no_tests = no_tests
|
||||||
self._create_remote_dirs = create_remote_dirs
|
self._create_remote_dirs = create_remote_dirs
|
||||||
|
|
||||||
|
if not data_dir:
|
||||||
data_dir = (Path(self.expand_path(os.getenv('XDG_DATA_HOME',
|
data_dir = (Path(self.expand_path(os.getenv('XDG_DATA_HOME',
|
||||||
'~/.local/share')))
|
'~/.local/share')))
|
||||||
/ f'{PROG}')
|
/ f'{PROG}')
|
||||||
|
else:
|
||||||
|
data_dir = Path(data_dir)
|
||||||
self.data_dir = data_dir
|
self.data_dir = data_dir
|
||||||
|
|
||||||
self.checksum_command = 'sha256sum'
|
self.checksum_command = 'sha256sum'
|
||||||
|
@ -22,13 +22,10 @@ class TestIntegrationImages(TestCase):
|
|||||||
|
|
||||||
with ExitStack() as stack:
|
with ExitStack() as stack:
|
||||||
stack.enter_context(mock.patch('subprocess.call', Call()))
|
stack.enter_context(mock.patch('subprocess.call', Call()))
|
||||||
stack.enter_context(mock.patch.dict(
|
|
||||||
'os.environ',
|
|
||||||
{'XDG_DATA_HOME': cls.work_dir.as_posix()}
|
|
||||||
))
|
|
||||||
|
|
||||||
cloud_build = CB(
|
cloud_build = CB(
|
||||||
config='tests/test_integration_images.yaml',
|
config='tests/test_integration_images.yaml',
|
||||||
|
data_dir=(cls.work_dir / 'cloud_build').as_posix(),
|
||||||
no_tests=True,
|
no_tests=True,
|
||||||
create_remote_dirs=True,
|
create_remote_dirs=True,
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user