Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
slapos.core
Commits
392a993b
Commit
392a993b
authored
Mar 22, 2022
by
Thomas Gambier
🚴🏼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: correctly cleanup HOME environment variable
parent
da036539
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
slapos/tests/test_collect.py
slapos/tests/test_collect.py
+3
-0
slapos/tests/test_configure_local.py
slapos/tests/test_configure_local.py
+1
-0
No files found.
slapos/tests/test_collect.py
View file @
392a993b
...
...
@@ -490,6 +490,7 @@ class TestCollectSnapshot(unittest.TestCase):
self
.
slap
=
slapos
.
slap
.
slap
()
self
.
app
=
SlapOSApp
()
self
.
temp_dir
=
tempfile
.
mkdtemp
()
self
.
addCleanup
(
os
.
environ
.
__setitem__
,
"HOME"
,
os
.
environ
[
"HOME"
])
os
.
environ
[
"HOME"
]
=
self
.
temp_dir
self
.
instance_root
=
tempfile
.
mkdtemp
()
self
.
software_root
=
tempfile
.
mkdtemp
()
...
...
@@ -638,6 +639,7 @@ class TestCollectEntity(unittest.TestCase):
def
setUp
(
self
):
self
.
temp_dir
=
tempfile
.
mkdtemp
()
self
.
addCleanup
(
os
.
environ
.
__setitem__
,
"HOME"
,
os
.
environ
[
"HOME"
])
os
.
environ
[
"HOME"
]
=
self
.
temp_dir
self
.
instance_root
=
tempfile
.
mkdtemp
()
self
.
software_root
=
tempfile
.
mkdtemp
()
...
...
@@ -850,6 +852,7 @@ class TestConsumptionReportBase(unittest.TestCase):
self
.
loadPredefinedDB
()
self
.
database
=
db
.
Database
(
self
.
instance_root
,
create
=
True
)
self
.
temp_dir
=
tempfile
.
mkdtemp
()
self
.
addCleanup
(
os
.
environ
.
__setitem__
,
"HOME"
,
os
.
environ
[
"HOME"
])
os
.
environ
[
"HOME"
]
=
self
.
temp_dir
self
.
software_root
=
tempfile
.
mkdtemp
()
...
...
slapos/tests/test_configure_local.py
View file @
392a993b
...
...
@@ -46,6 +46,7 @@ class TestConfigureLocal(unittest.TestCase):
self
.
slap
=
slapos
.
slap
.
slap
()
self
.
app
=
SlapOSApp
()
self
.
temp_dir
=
tempfile
.
mkdtemp
()
self
.
addCleanup
(
os
.
environ
.
__setitem__
,
"HOME"
,
os
.
environ
[
"HOME"
])
os
.
environ
[
"HOME"
]
=
self
.
temp_dir
self
.
instance_root
=
tempfile
.
mkdtemp
()
self
.
software_root
=
tempfile
.
mkdtemp
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment