Skip to content

Commit

Permalink
Use 0 as default version to distinguish faulty reports
Browse files Browse the repository at this point in the history
  • Loading branch information
epapbak committed May 29, 2024
1 parent 6baef78 commit d16849a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ccx_messaging/publishers/rule_processing_publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def publish(self, input_msg, report):

try:
msg_timestamp = input_msg["timestamp"]
msg_version = report.pop("version", 1)
msg_version = report.pop("version", 0)
output_msg = {
"OrgID": org_id,
"AccountNumber": account_number,
Expand Down
16 changes: 8 additions & 8 deletions test/publishers/rule_processing_publisher_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def test_publish_bad_argument(wrong_input_msg):
"ClusterName": "uuid",
"Report": {"reports": []},
"LastChecked": "a timestamp",
"Version": 1,
"Version": 0,
"RequestId": "a request id",
"Metadata": {"gathering_time": "2012-01-14T00:00:00Z"},
},
Expand All @@ -174,7 +174,7 @@ def test_publish_bad_argument(wrong_input_msg):
"ClusterName": "uuid",
"Report": {"reports": []},
"LastChecked": "a timestamp",
"Version": 1,
"Version": 0,
"RequestId": "a request id",
"Metadata": {"gathering_time": "2012-01-14T00:00:00Z"},
},
Expand All @@ -201,7 +201,7 @@ def test_publish_bad_argument(wrong_input_msg):
"ClusterName": "uuid",
"Report": {"reports": []},
"LastChecked": "a timestamp",
"Version": 1,
"Version": 0,
"RequestId": "a request id",
"Metadata": {"gathering_time": "2012-01-14T00:00:00Z"},
},
Expand All @@ -227,7 +227,7 @@ def test_publish_bad_argument(wrong_input_msg):
"ClusterName": "uuid",
"Report": {"reports": []},
"LastChecked": "a timestamp",
"Version": 1,
"Version": 0,
"RequestId": "a request id",
"Metadata": {"gathering_time": "2012-01-14T00:00:00Z"},
},
Expand All @@ -254,7 +254,7 @@ def test_publish_bad_argument(wrong_input_msg):
"ClusterName": "uuid",
"Report": {"reports": []},
"LastChecked": "a timestamp",
"Version": 1,
"Version": 0,
"RequestId": "a request id",
"Metadata": {"gathering_time": "2023-08-14T09:31:46Z"},
},
Expand All @@ -281,7 +281,7 @@ def test_publish_bad_argument(wrong_input_msg):
"ClusterName": "uuid",
"Report": {"reports": []},
"LastChecked": "a timestamp",
"Version": 1,
"Version": 0,
"RequestId": "a request id",
"Metadata": {"gathering_time": "2023-08-14T09:31:46Z"},
},
Expand All @@ -308,7 +308,7 @@ def test_publish_bad_argument(wrong_input_msg):
"ClusterName": "uuid",
"Report": {"reports": []},
"LastChecked": "a timestamp",
"Version": 1,
"Version": 0,
"RequestId": "a request id",
"Metadata": {"gathering_time": "2012-01-14T00:00:00Z"},
},
Expand All @@ -335,7 +335,7 @@ def test_publish_bad_argument(wrong_input_msg):
"ClusterName": "uuid",
"Report": {"reports": []},
"LastChecked": "a timestamp",
"Version": 1,
"Version": 0,
"RequestId": "a request id",
"Metadata": {"gathering_time": "2012-01-14T00:00:00Z"},
},
Expand Down

0 comments on commit d16849a

Please sign in to comment.