From a2e240702509deca4263134f7085444f20e2d120 Mon Sep 17 00:00:00 2001 From: Greg Back Date: Wed, 27 Jun 2018 12:49:00 -0500 Subject: [PATCH] GH-188: Fixes for old Python syntax. --- stix2/test/test_properties.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/stix2/test/test_properties.py b/stix2/test/test_properties.py index ef590c5..6280c57 100644 --- a/stix2/test/test_properties.py +++ b/stix2/test/test_properties.py @@ -99,7 +99,7 @@ def test_id_property_valid(value): assert ID_PROP.clean(value) == value -@pytest.mark.parametrize("value", [ +CONSTANT_IDS = [ constants.ATTACK_PATTERN_ID, constants.CAMPAIGN_ID, constants.COURSE_OF_ACTION_ID, @@ -115,11 +115,14 @@ def test_id_property_valid(value): constants.THREAT_ACTOR_ID, constants.TOOL_ID, constants.VULNERABILITY_ID, - *constants.MARKING_IDS, - *constants.RELATIONSHIP_IDS, -]) +] +CONSTANT_IDS.extend(constants.MARKING_IDS) +CONSTANT_IDS.extend(constants.RELATIONSHIP_IDS) + + +@pytest.mark.parametrize("value", CONSTANT_IDS) def test_id_property_valid_for_type(value): - type = value.split('--', maxsplit=1)[0] + type = value.split('--', 1)[0] assert IDProperty(type=type).clean(value) == value