Ejemplo n.º 1
0
    def test_get_all_cats(self):
        new_ids = ["foo", "bar", "baz"]
        for new_id in new_ids:
            self.r.hset(
                Category.CAT_META_HASH,
                "%s:signature" % (new_id), self.cat_sig
            )

        cats = Category.get_all_categories(self.r)
        self.assertEqual(len(cats), len(new_ids) + 1)
        for cat in cats:
            self.assertEqual(cat.signature, self.cat_sig)