Esempio n. 1
0
File: app.py Progetto: strk/cartman
    def get_tickets(self, query_string):
        """Wrapper around ``get_dicts()`` that returns ``Ticket`` instances.

        :param query_string: Starts with a slash, part of the URL between the
                             domain and the parameters (before the ?).
        """
        for ticket_dict in self.get_dicts(query_string):
            yield ticket.factory(ticket_dict)
Esempio n. 2
0
    def get_tickets(self, query_string):
        """Wrapper around ``get_dicts()`` that returns ``Ticket`` instances.

        :param query_string: Starts with a slash, part of the URL between the
                             domain and the parameters (before the ?).
        """
        for ticket_dict in self.get_dicts(query_string):
            yield ticket.factory(ticket_dict)
Esempio n. 3
0
    def test_ticket_factory_alt(self):
        t = ticket.factory({
            "ticket": "123",
            "_reporter": "douche",
        })

        self.assertEquals(t.id, 123)
        self.assertEquals(t.reporter, "douche")
Esempio n. 4
0
    def test_ticket_factory_alt(self):
        t = ticket.factory({
            "ticket": "123",
            "_reporter": "douche",
        })

        self.assertEquals(t.id, 123)
        self.assertEquals(t.reporter, "douche")
Esempio n. 5
0
    def test_ticket_factory(self):
        t = ticket.factory({
            "id": "245",
            "summary": "meh",
            "reporter": "douche",
            "description": "clean all the things",
        })

        self.assertEquals(t.id, 245)
        self.assertEquals(t.summary, "meh")
        self.assertEquals(t.reporter, "douche")
        self.assertEquals(t.description, "clean all the things")
Esempio n. 6
0
    def test_ticket_factory(self):
        t = ticket.factory({
            "id": "245",
            "summary": "meh",
            "reporter": "douche",
            "description": "clean all the things",
        })

        self.assertEquals(t.id, 245)
        self.assertEquals(t.summary, "meh")
        self.assertEquals(t.reporter, "douche")
        self.assertEquals(t.description, "clean all the things")