def test_interfaces(self): trail = Trail() event_constructor = Event( trail, 222, 555, [333, 444], ["test parameter", "other test parameter"]).set_timestamp(TIMESTAMP) event_plurals = Event(trail, 222).set_timestamp(TIMESTAMP) event_plurals.set_instance_id(555) event_plurals.add_static_params([333, 444]) event_plurals.add_variable_params(["test parameter", "other test parameter"]) event_singles = Event(trail, 222).set_timestamp(TIMESTAMP) event_singles.set_instance_id(555) event_singles.add_static_param(333).add_static_param(444) event_singles.add_variable_param("test parameter")\ .add_variable_param("other test parameter") self.assertEqual(event_constructor.serialize(), event_plurals.serialize()) self.assertEqual(event_constructor.serialize(), event_singles.serialize()) self.assertEqual(event_constructor.serialize(), EVENT_STRING_ALL)
def test_interfaces(self): trail = Trail() event_constructor = Event(trail, 222, 555, [333, 444], ["test parameter", "other test parameter" ]).set_timestamp(TIMESTAMP) event_plurals = Event(trail, 222).set_timestamp(TIMESTAMP) event_plurals.set_instance_id(555) event_plurals.add_static_params([333, 444]) event_plurals.add_variable_params( ["test parameter", "other test parameter"]) event_singles = Event(trail, 222).set_timestamp(TIMESTAMP) event_singles.set_instance_id(555) event_singles.add_static_param(333).add_static_param(444) event_singles.add_variable_param("test parameter")\ .add_variable_param("other test parameter") self.assertEqual(event_constructor.serialize(), event_plurals.serialize()) self.assertEqual(event_constructor.serialize(), event_singles.serialize()) self.assertEqual(event_constructor.serialize(), EVENT_STRING_ALL)
def test_one_static_param(self): event = Event(Trail(), 222).set_timestamp(TIMESTAMP) event.add_static_param(333) self.assertEqual(event.serialize(), EVENT_STRING_ONE_STATIC)