Exemplo n.º 1
0
 def test_generate_event_key(self):
     self.assertEqual("longpoll.event.event-name",
                      generate_event_key("event-name"))
     self.assertEqual("longpoll.event.source-name.event-name",
                      generate_event_key("source-name", "event-name"))
     self.assertEqual(
         "longpoll.event.type-name.source-name.event-name",
         generate_event_key("type-name", "source-name", "event-name"))
Exemplo n.º 2
0
 def test_generate_event_key(self):
     self.assertEqual(
         "longpoll.event.event-name",
         generate_event_key("event-name"))
     self.assertEqual(
         "longpoll.event.source-name.event-name",
         generate_event_key("source-name", "event-name"))
     self.assertEqual(
         "longpoll.event.type-name.source-name.event-name",
         generate_event_key("type-name", "source-name", "event-name"))
Exemplo n.º 3
0
    def event_key(self):
        """See `ILongPollEvent`.

        Constructs the key from the table name of the Storm class.
        """
        cls_info = get_cls_info(self.source)
        return generate_event_key(cls_info.table.name.lower())
Exemplo n.º 4
0
    def event_key(self):
        """See `ILongPollEvent`.

        Constructs the key from the table name of the Storm class.
        """
        cls_info = get_cls_info(self.source)
        return generate_event_key(
            cls_info.table.name.lower())
Exemplo n.º 5
0
    def event_key(self):
        """See `ILongPollEvent`.

        Constructs the key from the table name and primary key values of the
        Storm model object.
        """
        cls_info = get_obj_info(self.source).cls_info
        return generate_event_key(cls_info.table.name.lower(),
                                  *gen_primary_key(self.source))
Exemplo n.º 6
0
    def event_key(self):
        """See `ILongPollEvent`.

        Constructs the key from the table name and primary key values of the
        Storm model object.
        """
        cls_info = get_obj_info(self.source).cls_info
        return generate_event_key(
            cls_info.table.name.lower(),
            *gen_primary_key(self.source))
Exemplo n.º 7
0
 def test_generate_event_key_stringifies_components(self):
     self.assertEqual(
         "longpoll.event.job.1234.COMPLETED",
         generate_event_key("job", 1234, "COMPLETED"))
Exemplo n.º 8
0
 def test_generate_event_key_stringifies_components(self):
     self.assertEqual("longpoll.event.job.1234.COMPLETED",
                      generate_event_key("job", 1234, "COMPLETED"))