From 1b3721936349bd39e3c551c1645e1747910c3c0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98ystein=20S=2E=20Haaland?= Date: Wed, 1 Mar 2023 14:58:55 +0100 Subject: [PATCH] Add test with `none` in event_properties --- src/test/test_event.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/test/test_event.py b/src/test/test_event.py index 91c8c78..f5a6acf 100644 --- a/src/test/test_event.py +++ b/src/test/test_event.py @@ -153,6 +153,14 @@ def test_base_event_set_bool_in_dict_attributes_success(self): expect_dict["event_properties"] = {"bool_properties": bool_properties} self.assertEqual(expect_dict, event.get_event_body()) + def test_base_event_set_none_in_dict_attributes_success(self): + event = BaseEvent(event_type="test_event", user_id="test_user") + expect_dict = {"event_type": "test_event", "user_id": "test_user"} + none_properties = None + event["event_properties"] = {"none_properties": none_properties} + expect_dict["event_properties"] = {"none_properties": none_properties} + self.assertEqual(expect_dict, event.get_event_body()) + def test_base_event_set_numeric_in_dict_attributes_success(self): event = BaseEvent(event_type="test_event", user_id="test_user") expect_dict = {"event_type": "test_event", "user_id": "test_user"}