def test_filter_categories_for_sanity(self): ''' Test the simple filter options. ''' res = workflow.filter_categories([], self.registry) self.assertTrue(self.kind1 in res) self.assertTrue(self.kind2 in res) self.assertTrue(len(res) == 2) res = workflow.filter_categories([self.kind1], self.registry) self.assertTrue(self.kind1 in res) self.assertFalse(self.kind2 in res) self.assertTrue(len(res) == 1)
def get(self): # retrieve (filter) try: categories, attributes = self.parse_filter() result = workflow.filter_categories(categories, self.registry) self.render_categories(result) except AttributeError as attr: raise HTTPError(400, str(attr))