def test_big_filter(self): arra = open('tests/arra.csv') t = TableFu(arra) f = t.filter(State='ALABAMA', County='COLBERT') self.assertEqual(f.count(), 5)
def test_simple_filter(self): "Filter by keyword args" t = TableFu(self.csv_file) f = t.filter(Author='Samuel Beckett') self.assertEqual(f[0].cells, self.table[1])
def test_multi_filter(self): "Filter by multiple keywords" t = TableFu(self.csv_file) f = t.filter(Style='Modernism', Author='Samuel Beckett') self.assertEqual(f[0].cells, self.table[1])
def test_filter(self): "Filtering returns a new TableFu instance" t = TableFu(self.csv_file) f = t.filter(Author='Samuel Beckett') self.assertEqual(type(t), type(f)) self.assertEqual(t.columns, f.columns)