diff --git a/stix2/test/test_workbench.py b/stix2/test/test_workbench.py index d1d4328..fd62703 100644 --- a/stix2/test/test_workbench.py +++ b/stix2/test/test_workbench.py @@ -3,7 +3,7 @@ import os import stix2 from stix2.workbench import ( - AttackPattern, Campaign, CourseOfAction, ExternalReference, + _STIX_VID, AttackPattern, Campaign, CourseOfAction, ExternalReference, FileSystemSource, Filter, Identity, Indicator, IntrusionSet, Malware, MarkingDefinition, ObservedData, Relationship, Report, StatementMarking, ThreatActor, Tool, Vulnerability, add_data_source, all_versions, @@ -14,7 +14,6 @@ from stix2.workbench import ( ) # Auto-detect some settings based on the current default STIX version -_STIX_VID = "v" + stix2.DEFAULT_VERSION.replace(".", "") _STIX_DATA_PATH = os.path.join( os.path.dirname(os.path.realpath(__file__)), _STIX_VID, diff --git a/stix2/workbench.py b/stix2/workbench.py index f0abdf9..c5aac6e 100644 --- a/stix2/workbench.py +++ b/stix2/workbench.py @@ -53,6 +53,11 @@ from . import ( # noqa: F401 ) from .datastore.filters import FilterSet + +# Enable some adaptation to the current default supported STIX version. +_STIX_VID = "v" + stix2.DEFAULT_VERSION.replace(".", "") + + # Use an implicit MemoryStore _environ = Environment(store=MemoryStore()) @@ -133,7 +138,11 @@ def _setup_workbench(): # have undesirable side-effects, but actually it seems to work. # So far... new_class_dict = { - '__doc__': 'Workbench wrapper around the `{0} `__ object. {1}'.format(obj_type.__name__, STIX_OBJ_DOCS), + '__doc__': 'Workbench wrapper around the `{0} `__ object. {2}'.format( + obj_type.__name__, + _STIX_VID, + STIX_OBJ_DOCS, + ), 'created_by': _created_by_wrapper, 'relationships': _relationships_wrapper, 'related': _related_wrapper,