Tests: assertion related fixes.

This commit is contained in:
Andrei Zeliankou
2023-05-25 16:56:14 +01:00
parent 0132e552d0
commit b034bf6703
11 changed files with 90 additions and 95 deletions

View File

@@ -15,24 +15,22 @@ class TestPythonIsolation(TestApplicationPython):
self.load('ns_inspect', isolation=isolation)
assert (
assert not (
self.getjson(url=f'/?path={temp_dir}')['body']['FileExists']
== False
), 'temp_dir does not exists in rootfs'
assert (
self.getjson(url='/?path=/proc/self')['body']['FileExists'] == True
), 'no /proc/self'
assert self.getjson(url='/?path=/proc/self')['body'][
'FileExists'
], 'no /proc/self'
assert (
self.getjson(url='/?path=/dev/pts')['body']['FileExists'] == False
assert not (
self.getjson(url='/?path=/dev/pts')['body']['FileExists']
), 'no /dev/pts'
assert (
assert not (
self.getjson(url='/?path=/sys/kernel')['body']['FileExists']
== False
), 'no /sys/kernel'
ret = self.getjson(url='/?path=/app/python/ns_inspect')
assert ret['body']['FileExists'] == True, 'application exists in rootfs'
assert ret['body']['FileExists'], 'application exists in rootfs'