From b5015b74ba3add1818bee6de433a07469f9b39ba Mon Sep 17 00:00:00 2001 From: Michael Chisholm Date: Wed, 19 Aug 2020 12:10:51 -0400 Subject: [PATCH] pre-commit stylistic fixes --- stix2/test/v20/test_pattern_equivalence.py | 17 +++++++++-------- stix2/test/v21/test_pattern_equivalence.py | 17 +++++++++-------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/stix2/test/v20/test_pattern_equivalence.py b/stix2/test/v20/test_pattern_equivalence.py index bf50e95..1ada5c7 100644 --- a/stix2/test/v20/test_pattern_equivalence.py +++ b/stix2/test/v20/test_pattern_equivalence.py @@ -3,6 +3,7 @@ Pattern equivalence unit tests which use STIX 2.0-specific pattern features """ import pytest + from stix2.equivalence.patterns import equivalent_patterns @@ -10,17 +11,17 @@ from stix2.equivalence.patterns import equivalent_patterns "patt1, patt2", [ ( "[a:b=1] START '1993-06-29T15:24:42Z' STOP '2000-07-30T19:29:58Z'", - "[a:b=1 OR (a:c=2 AND a:b=1)] START '1993-06-29T15:24:42Z' STOP '2000-07-30T19:29:58Z'" + "[a:b=1 OR (a:c=2 AND a:b=1)] START '1993-06-29T15:24:42Z' STOP '2000-07-30T19:29:58Z'", ), ( "[a:b=1] START '1993-06-29T15:24:42Z' STOP '2000-07-30T19:29:58Z' WITHIN 2 SECONDS", - "[a:b=1 OR (a:c=2 AND a:b=1)] START '1993-06-29T15:24:42Z' STOP '2000-07-30T19:29:58Z' WITHIN 2 SECONDS" + "[a:b=1 OR (a:c=2 AND a:b=1)] START '1993-06-29T15:24:42Z' STOP '2000-07-30T19:29:58Z' WITHIN 2 SECONDS", ), ( "[a:b=1] REPEATS 2 TIMES REPEATS 2 TIMES", "([a:b=1] REPEATS 2 TIMES) REPEATS 2 TIMES", - ) - ] + ), + ], ) def test_startstop_equivalent(patt1, patt2): assert equivalent_patterns(patt1, patt2, stix_version="2.0") @@ -30,17 +31,17 @@ def test_startstop_equivalent(patt1, patt2): "patt1, patt2", [ ( "[a:b!=1] START '1993-06-29T15:24:42Z' STOP '2000-07-30T19:29:58Z'", - "[a:b!=1] START '1977-09-29T07:41:03Z' STOP '1996-09-18T22:46:07Z'" + "[a:b!=1] START '1977-09-29T07:41:03Z' STOP '1996-09-18T22:46:07Z'", ), ( "[a:b<1] REPEATS 2 TIMES START '1993-06-29T15:24:42Z' STOP '2000-07-30T19:29:58Z'", - "[a:b<1] REPEATS 2 TIMES START '1977-09-29T07:41:03Z' STOP '1996-09-18T22:46:07Z'" + "[a:b<1] REPEATS 2 TIMES START '1977-09-29T07:41:03Z' STOP '1996-09-18T22:46:07Z'", ), ( "[a:b=1] REPEATS 2 TIMES REPEATS 2 TIMES", "([a:b=1] REPEATS 2 TIMES) REPEATS 3 TIMES", - ) - ] + ), + ], ) def test_startstop_not_equivalent(patt1, patt2): assert not equivalent_patterns(patt1, patt2, stix_version="2.0") diff --git a/stix2/test/v21/test_pattern_equivalence.py b/stix2/test/v21/test_pattern_equivalence.py index e7bd5b4..71ded69 100644 --- a/stix2/test/v21/test_pattern_equivalence.py +++ b/stix2/test/v21/test_pattern_equivalence.py @@ -3,6 +3,7 @@ Pattern equivalence unit tests which use STIX 2.1+-specific pattern features """ import pytest + from stix2.equivalence.patterns import equivalent_patterns @@ -10,17 +11,17 @@ from stix2.equivalence.patterns import equivalent_patterns "patt1, patt2", [ ( "[a:b=1] START t'1993-06-29T15:24:42Z' STOP t'2000-07-30T19:29:58Z'", - "[a:b=1 OR (a:c=2 AND a:b=1)] START t'1993-06-29T15:24:42Z' STOP t'2000-07-30T19:29:58Z'" + "[a:b=1 OR (a:c=2 AND a:b=1)] START t'1993-06-29T15:24:42Z' STOP t'2000-07-30T19:29:58Z'", ), ( "[a:b=1] START t'1993-06-29T15:24:42Z' STOP t'2000-07-30T19:29:58Z' WITHIN 2 SECONDS", - "[a:b=1 OR (a:c=2 AND a:b=1)] START t'1993-06-29T15:24:42Z' STOP t'2000-07-30T19:29:58Z' WITHIN 2 SECONDS" + "[a:b=1 OR (a:c=2 AND a:b=1)] START t'1993-06-29T15:24:42Z' STOP t'2000-07-30T19:29:58Z' WITHIN 2 SECONDS", ), ( "([a:b=1]) REPEATS 2 TIMES REPEATS 2 TIMES", "([a:b=1] REPEATS 2 TIMES) REPEATS 2 TIMES", - ) - ] + ), + ], ) def test_startstop_equivalent(patt1, patt2): assert equivalent_patterns(patt1, patt2, stix_version="2.1") @@ -30,17 +31,17 @@ def test_startstop_equivalent(patt1, patt2): "patt1, patt2", [ ( "[a:b!=1] START t'1993-06-29T15:24:42Z' STOP t'2000-07-30T19:29:58Z'", - "[a:b!=1] START t'1977-09-29T07:41:03Z' STOP t'1996-09-18T22:46:07Z'" + "[a:b!=1] START t'1977-09-29T07:41:03Z' STOP t'1996-09-18T22:46:07Z'", ), ( "[a:b<1] REPEATS 2 TIMES START t'1993-06-29T15:24:42Z' STOP t'2000-07-30T19:29:58Z'", - "[a:b<1] REPEATS 2 TIMES START t'1977-09-29T07:41:03Z' STOP t'1996-09-18T22:46:07Z'" + "[a:b<1] REPEATS 2 TIMES START t'1977-09-29T07:41:03Z' STOP t'1996-09-18T22:46:07Z'", ), ( "([a:b=1]) REPEATS 2 TIMES REPEATS 2 TIMES", "([a:b=1] REPEATS 2 TIMES) REPEATS 3 TIMES", - ) - ] + ), + ], ) def test_startstop_not_equivalent(patt1, patt2): assert not equivalent_patterns(patt1, patt2, stix_version="2.1")