diff --git a/stix2/__init__.py b/stix2/__init__.py index dfffec0..c5cf3f3 100644 --- a/stix2/__init__.py +++ b/stix2/__init__.py @@ -50,10 +50,11 @@ from .patterns import (AndBooleanExpression, AndObservationExpression, ReferenceObjectPathComponent, RepeatQualifier, StartStopQualifier, StringConstant, TimestampConstant, WithinQualifier) +from .STIXPatternVisitor import create_pattern_object from .utils import new_version, revoke from .v20 import * # This import will always be the latest STIX 2.X version from .version import __version__ -from .STIXPatternVisitor import create_pattern_object + _collect_stix2_obj_maps() diff --git a/stix2/test/test_pattern_expressions.py b/stix2/test/test_pattern_expressions.py index ec656c8..91aee5a 100644 --- a/stix2/test/test_pattern_expressions.py +++ b/stix2/test/test_pattern_expressions.py @@ -506,12 +506,12 @@ def test_make_constant_already_a_constant(): def test_parsing_comparison_expression(): - patt_obj = create_pattern_object("[file:hashes.'SHA-256' = 'aec070645fe53ee3b3763059376134f058cc337247c978add178b6ccdfb0019f']") + patt_obj = stix2.create_pattern_object("[file:hashes.'SHA-256' = 'aec070645fe53ee3b3763059376134f058cc337247c978add178b6ccdfb0019f']") assert str(patt_obj) == "[file:hashes.'SHA-256' = 'aec070645fe53ee3b3763059376134f058cc337247c978add178b6ccdfb0019f']" def test_parsing_qualified_expression(): - patt_obj = create_pattern_object( + patt_obj = stix2.create_pattern_object( "[network-traffic:dst_ref.type = 'domain-name' AND network-traffic:dst_ref.value = 'example.com'] REPEATS 5 TIMES WITHIN 1800 SECONDS") assert str( patt_obj) == "[network-traffic:dst_ref.type = 'domain-name' AND network-traffic:dst_ref.value = 'example.com'] REPEATS 5 TIMES WITHIN 1800 SECONDS"