diff --git a/google/refine.py b/google/refine.py index 1632651..39ff6bb 100644 --- a/google/refine.py +++ b/google/refine.py @@ -70,13 +70,16 @@ class TextFacet(Facet): if s['v']['v'] == value: return self.selection.append({'v': {'v': value, 'l': value}}) + return self def exclude(self, value): self.selection = [s for s in self.selection if s['v']['v'] != value] + return self def reset(self): self.selection = [] + return self class StarredFacet(TextFacet): diff --git a/google/test/test_engine.py b/google/test/test_engine.py index c179989..f94cf5c 100644 --- a/google/test/test_engine.py +++ b/google/test/test_engine.py @@ -79,6 +79,8 @@ class FacetTest(unittest.TestCase): self.assertEqual(len(facet.selection), 1) facet.reset() self.assertEqual(len(facet.selection), 0) + facet.include('element').include('element 2') + self.assertEqual(len(facet.selection), 2) def test_reset_remove(self): text_facet1 = TextFacet('column name')