Пример #1
0
 def test_ordering(self):
     trail = Trail()
     marker_static_first = Marker(trail, 222).set_timestamp(TIMESTAMP)
     marker_static_first.add_static_params([333, 444])
     marker_static_first.add_variable_params(["test parameter", "other test parameter"])
     marker_static_first.set_instance_id(555)
     marker_variable_first = Marker(trail, 222).set_timestamp(TIMESTAMP)
     marker_variable_first.add_variable_params(["test parameter", "other test parameter"])
     marker_variable_first.set_instance_id(555)
     marker_variable_first.add_static_params([333, 444]).set_timestamp(TIMESTAMP)
     self.assertEqual(marker_static_first.serialize(), marker_variable_first.serialize())
     self.assertEqual(marker_static_first.serialize(), MARKER_STRING_ALL)
Пример #2
0
 def test_interfaces(self):
     trail = Trail()
     marker_constructor = Marker(
         trail,
         222,
         555,
         False,
         SCOPE_NONE,
         [333, 444],
         ["test parameter", "other test parameter"]).set_timestamp(TIMESTAMP)
     marker_plurals = Marker(trail, 222).set_timestamp(TIMESTAMP)
     marker_plurals.set_instance_id(555)
     marker_plurals.add_static_params([333, 444])
     marker_plurals.add_variable_params(["test parameter", "other test parameter"])
     marker_singles = Marker(trail, 222).set_timestamp(TIMESTAMP)
     marker_singles.set_instance_id(555)
     marker_singles.add_static_param(333).add_static_param(444)
     marker_singles.add_variable_param("test parameter")\
         .add_variable_param("other test parameter")
     self.assertEqual(marker_constructor.serialize(), marker_plurals.serialize())
     self.assertEqual(marker_constructor.serialize(), marker_singles.serialize())
     self.assertEqual(marker_constructor.serialize(), MARKER_STRING_ALL)