Skip to content

Commit

Permalink
Format filters.py
Browse files Browse the repository at this point in the history
  • Loading branch information
JokeWaumans committed Aug 20, 2024
1 parent 9ff51df commit eee1bc1
Showing 1 changed file with 68 additions and 50 deletions.
118 changes: 68 additions & 50 deletions tests/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
{
"columnKey": "streams",
"matchMode": "oneOrMoreMatch",
"matchers": [{"class": "Stream", "name": "test_stream", "type": "nameMatcher"}]
"matchers": [{"class": "Stream", "name": "test_stream", "type": "nameMatcher"}],
}
],
"columns": ["cid"],
"snapshotScope": {
"show": {"scope": "last()", "includeOutdatedSnapshots": False},
"compareTo": {"scope": "last()", "includeOutdatedSnapshots": False}
}
}
"compareTo": {"scope": "last()", "includeOutdatedSnapshots": False},
},
},
)

test_defect_filter_1 = Filter(
Expand All @@ -45,30 +45,39 @@
"cid": None,
},
["CID", "Classification", "Checker", "Comment"],
{"filters": [
{"columnKey": "streams", "matchMode": "oneOrMoreMatch", "matchers": [
{"class": "Stream", "name": "test_stream", "type": "nameMatcher"}
]
},
{"columnKey": "checker", "matchMode": "oneOrMoreMatch", "matchers": [
{"type": "keyMatcher", "key": "MISRA 2"},
{"type": "keyMatcher", "key": "MISRA 1"},
{"type": "keyMatcher", "key": "MISRA 3"}
]
{
"filters": [
{
"columnKey": "streams",
"matchMode": "oneOrMoreMatch",
"matchers": [{"class": "Stream", "name": "test_stream", "type": "nameMatcher"}],
},
{
"columnKey": "checker",
"matchMode": "oneOrMoreMatch",
"matchers": [
{"type": "keyMatcher", "key": "MISRA 2"},
{"type": "keyMatcher", "key": "MISRA 1"},
{"type": "keyMatcher", "key": "MISRA 3"},
],
},
{
"columnKey": "classification",
"matchMode": "oneOrMoreMatch",
"matchers": [
{"type": "keyMatcher", "key": "Bug"},
{"type": "keyMatcher", "key": "Pending"},
{"type": "keyMatcher", "key": "Unclassified"},
{"type": "keyMatcher", "key": "Intentional"},
],
},
],
"columns": ["cid", "checker", "lastTriageComment", "classification"],
"snapshotScope": {
"show": {"scope": "last()", "includeOutdatedSnapshots": False},
"compareTo": {"scope": "last()", "includeOutdatedSnapshots": False},
},
{"columnKey": "classification", "matchMode": "oneOrMoreMatch", "matchers": [
{"type": "keyMatcher", "key": "Bug"},
{"type": "keyMatcher", "key": "Pending"},
{"type": "keyMatcher", "key": "Unclassified"},
{"type": "keyMatcher", "key": "Intentional"}
]
}
],
"columns": ["cid", "checker", "lastTriageComment", "classification"],
"snapshotScope": {
"show": {"scope": "last()", "includeOutdatedSnapshots": False},
"compareTo": {"scope": "last()", "includeOutdatedSnapshots": False}
}}
},
)

test_defect_filter_2 = Filter(
Expand All @@ -83,16 +92,20 @@
"cid": None,
},
["CID", "Checker", "Status", "Comment"],
{'filters': [
{'columnKey': 'streams', 'matchMode': 'oneOrMoreMatch', 'matchers': [
{'class': 'Stream', 'name': 'test_stream', 'type': 'nameMatcher'}
]
}],
'columns': ['status', 'cid', 'checker', 'lastTriageComment'],
'snapshotScope': {
'show': {'scope': 'last()', 'includeOutdatedSnapshots': False},
'compareTo': {'scope': 'last()', 'includeOutdatedSnapshots': False}
}}
{
"filters": [
{
"columnKey": "streams",
"matchMode": "oneOrMoreMatch",
"matchers": [{"class": "Stream", "name": "test_stream", "type": "nameMatcher"}],
}
],
"columns": ["status", "cid", "checker", "lastTriageComment"],
"snapshotScope": {
"show": {"scope": "last()", "includeOutdatedSnapshots": False},
"compareTo": {"scope": "last()", "includeOutdatedSnapshots": False},
},
},
)

test_defect_filter_3 = Filter(
Expand All @@ -107,18 +120,23 @@
"cid": None,
},
["CID", "Classification", "Action"],
{'filters': [
{'columnKey': 'streams', 'matchMode': 'oneOrMoreMatch', 'matchers': [
{'class': 'Stream', 'name': 'test_stream', 'type': 'nameMatcher'}
]
{
"filters": [
{
"columnKey": "streams",
"matchMode": "oneOrMoreMatch",
"matchers": [{"class": "Stream", "name": "test_stream", "type": "nameMatcher"}],
},
{
"columnKey": "classification",
"matchMode": "oneOrMoreMatch",
"matchers": [{"type": "keyMatcher", "key": "Unclassified"}],
},
],
"columns": ["cid", "classification", "action"],
"snapshotScope": {
"show": {"scope": "last()", "includeOutdatedSnapshots": False},
"compareTo": {"scope": "last()", "includeOutdatedSnapshots": False},
},
{'columnKey': 'classification', 'matchMode': 'oneOrMoreMatch', 'matchers': [
{'type': 'keyMatcher', 'key': 'Unclassified'}
]
}],
'columns': ['cid', 'classification', 'action'],
'snapshotScope': {
'show': {'scope': 'last()', 'includeOutdatedSnapshots': False},
'compareTo': {'scope': 'last()', 'includeOutdatedSnapshots': False}
}}
},
)

0 comments on commit eee1bc1

Please sign in to comment.