summaryrefslogtreecommitdiffstats
path: root/tests/bzip2/run_tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/bzip2/run_tests.py')
-rw-r--r--tests/bzip2/run_tests.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/bzip2/run_tests.py b/tests/bzip2/run_tests.py
index c4ee56d..677ac84 100644
--- a/tests/bzip2/run_tests.py
+++ b/tests/bzip2/run_tests.py
@@ -1,5 +1,5 @@
import pytest
-
+import pathlib
import tests.bzip2.parser as parser
from plugins.agl_test_ptest_base import PTESTBase
@@ -13,6 +13,10 @@ class BZIP2Base(PTESTBase):
self.case_info_list = parser.log_parse(log_file)
self.init_case_status()
+ def precheck(self):
+ path_bzip2 = pathlib.Path("/usr/bin/bzip2")
+ return super().precheck() and path_bzip2.is_file()
+
@pytest.fixture(scope='module')
def testbase():
#init instance for test
@@ -29,6 +33,12 @@ def testbase():
def setup_module(testbase: BZIP2Base):
print("setup function start")
+def precheck():
+ instance = BZIP2Base()
+ return instance.precheck()
+skip_msg = "The current environment does not match the test requirements."
+pytestmark = pytest.mark.skipif(precheck() == False, reason = skip_msg)
+
def test_sample1_compress(testbase: BZIP2Base):
name = "sample1 compress"
testbase.run_case(name)