diff --git a/tests/artifacts/generate_stix.py b/tests/artifacts/generate_stix.py index 1503529..418a732 100644 --- a/tests/artifacts/generate_stix.py +++ b/tests/artifacts/generate_stix.py @@ -23,22 +23,22 @@ def generate_test_stix_file(file_path): for d in domains: i = Indicator(indicator_types=["malicious-activity"], pattern="[domain-name:value='{}']".format(d), pattern_type="stix") res.append(i) - res.append(Relationship(i, 'indicates', malware)) + res.append(Relationship(i, "indicates", malware)) for p in processes: i = Indicator(indicator_types=["malicious-activity"], pattern="[process:name='{}']".format(p), pattern_type="stix") res.append(i) - res.append(Relationship(i, 'indicates', malware)) + res.append(Relationship(i, "indicates", malware)) for f in filenames: i = Indicator(indicator_types=["malicious-activity"], pattern="[file:name='{}']".format(f), pattern_type="stix") res.append(i) - res.append(Relationship(i, 'indicates', malware)) + res.append(Relationship(i, "indicates", malware)) for e in emails: i = Indicator(indicator_types=["malicious-activity"], pattern="[email-addr:value='{}']".format(e), pattern_type="stix") res.append(i) - res.append(Relationship(i, 'indicates', malware)) + res.append(Relationship(i, "indicates", malware)) bundle = Bundle(objects=res) with open(file_path, "w+") as f: diff --git a/tests/conftest.py b/tests/conftest.py index 9323d11..ee45c80 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -21,6 +21,6 @@ def indicator_file(request, tmp_path_factory): @pytest.fixture(scope="session", autouse=True) def clean_test_env(request, tmp_path_factory): try: - del os.environ['MVT_STIX2'] + del os.environ["MVT_STIX2"] except KeyError: pass diff --git a/tests/ios/test_backup_info.py b/tests/ios/test_backup_info.py index ed41707..0509f6d 100644 --- a/tests/ios/test_backup_info.py +++ b/tests/ios/test_backup_info.py @@ -16,4 +16,4 @@ class TestBackupInfoModule: m = BackupInfo(base_folder=get_backup_folder(), log=logging) run_module(m) assert m.results["Build Version"] == "18C66" - assert m.results["IMEI"] == '42' + assert m.results["IMEI"] == "42" diff --git a/tests/ios/test_datausage.py b/tests/ios/test_datausage.py index feaa103..6053d65 100644 --- a/tests/ios/test_datausage.py +++ b/tests/ios/test_datausage.py @@ -24,7 +24,7 @@ class TestDatausageModule: m = Datausage(base_folder=get_backup_folder(), log=logging, results=[]) ind = Indicators(log=logging) ind.parse_stix2(indicator_file) - # Adds a file that exists in the manifest + # Adds a file that exists in the manifest. ind.ioc_processes[0] = "CumulativeUsageTracker" m.indicators = ind run_module(m) diff --git a/tests/utils.py b/tests/utils.py index a9a2b0b..ebc0bfe 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -23,5 +23,6 @@ def get_artifact_folder(): def get_backup_folder(): return os.path.join(os.path.dirname(__file__), "artifacts", "ios_backup") + def get_indicator_file(): - print("PYTEST env", os.getenv('PYTEST_CURRENT_TEST')) + print("PYTEST env", os.getenv("PYTEST_CURRENT_TEST"))