mirror of
https://github.com/containers/podman-compose.git
synced 2025-05-29 14:41:21 +02:00
tests: Test selected env variables to improve robustness
Signed-off-by: Justin Zhang <schnell18@gmail.com>
This commit is contained in:
parent
d532e09d7d
commit
8638eb9b6d
@ -80,18 +80,25 @@ class TestComposeExteds(unittest.TestCase, RunSubprocessMixin):
|
|||||||
"env1",
|
"env1",
|
||||||
])
|
])
|
||||||
lines = output.decode('utf-8').split('\n')
|
lines = output.decode('utf-8').split('\n')
|
||||||
# HOSTNAME name is random string so is ignored in asserting
|
# Test selected env variables to improve robustness
|
||||||
lines = sorted([line for line in lines if not line.startswith("HOSTNAME")])
|
lines = sorted([
|
||||||
|
line
|
||||||
|
for line in lines
|
||||||
|
if line.startswith("BAR")
|
||||||
|
or line.startswith("BAZ")
|
||||||
|
or line.startswith("FOO")
|
||||||
|
or line.startswith("HOME")
|
||||||
|
or line.startswith("PATH")
|
||||||
|
or line.startswith("container")
|
||||||
|
])
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
lines,
|
lines,
|
||||||
[
|
[
|
||||||
'',
|
|
||||||
'BAR=local',
|
'BAR=local',
|
||||||
'BAZ=local',
|
'BAZ=local',
|
||||||
'FOO=original',
|
'FOO=original',
|
||||||
'HOME=/root',
|
'HOME=/root',
|
||||||
'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
|
'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
|
||||||
'TERM=xterm',
|
|
||||||
'container=podman',
|
'container=podman',
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user