예제 #1
0
    def test_decrements_total_count_and_removes_mails_id_from_mails(self):
        tag = Tag('one_more')
        tag.mails = set([12])
        tag.decrement(12)

        self.assertNotIn(12, tag.mails)
        self.assertEquals(0, tag.total)
예제 #2
0
    def test_decrements_total_count_and_removes_mails_id_from_mails(self):
        tag = Tag('one_more')
        tag.mails = set([12])
        tag.decrement(12)

        self.assertNotIn(12, tag.mails)
        self.assertEquals(0, tag.total)
예제 #3
0
    def test_as_dict_puts_all_tag_attributes_in_the_returning_dict(self):
        tag = Tag('some_tag', default=True)
        tag.counts = {'total': 0, 'read': 0, 'starred': 0, 'replied': 0}
        tag.mails = [1, 2, 3]

        tag_dict = tag.as_dict()

        self.assertEquals(tag.name, tag_dict['name'])
        self.assertEquals(tag.default, tag_dict['default'])
        self.assertEquals(tag.total, tag_dict['counts']['total'])
        self.assertEquals(tag.mails, tag_dict['mails'])
예제 #4
0
    def test_as_dict_puts_all_tag_attributes_in_the_returning_dict(self):
        tag = Tag('some_tag', default=True)
        tag.counts = {'total': 0, 'read': 0, 'starred': 0, 'replied': 0}
        tag.mails = [1, 2, 3]

        tag_dict = tag.as_dict()

        self.assertEquals(tag.name, tag_dict['name'])
        self.assertEquals(tag.default, tag_dict['default'])
        self.assertEquals(tag.total, tag_dict['counts']['total'])
        self.assertEquals(tag.mails, tag_dict['mails'])
예제 #5
0
    def test_increment_does_nothing_if_mail_already_has_the_tag(self):
        tag = Tag('tag')
        tag.mails = set([12])
        tag.increment(12)

        self.assertEquals(1, tag.total)
예제 #6
0
    def test_increment_does_nothing_if_mail_already_has_the_tag(self):
        tag = Tag('tag')
        tag.mails = set([12])
        tag.increment(12)

        self.assertEquals(1, tag.total)