def setUp(self): from xlutils.filter import BaseFilter self.filter = BaseFilter() self.filter.next = self.tf = Mock()
class TestBaseFilter(TestCase): def setUp(self): from xlutils.filter import BaseFilter self.filter = BaseFilter() self.filter.next = self.tf = Mock() def test_start(self): self.filter.start() self.assertEqual(self.tf.method_calls,[ ('start',(),{}) ]) def test_workbook(self): self.filter.workbook('rdbook','wtbook_name') self.assertEqual(self.tf.method_calls,[ ('workbook',('rdbook','wtbook_name'),{}) ]) def test_sheet(self): self.filter.sheet('rdsheet','wtsheet_name') self.assertEqual(self.tf.method_calls,[ ('sheet',('rdsheet','wtsheet_name'),{}) ]) def test_set_rdsheet(self): self.filter.set_rdsheet('rdsheet2') self.assertEqual(self.tf.method_calls,[ ('set_rdsheet',('rdsheet2',),{}) ]) def test_row(self): self.filter.row(0,1) self.assertEqual(self.tf.method_calls,[ ('row',(0,1),{}) ]) def test_cell(self): self.filter.cell(0,1,2,3) self.assertEqual(self.tf.method_calls,[ ('cell',(0,1,2,3),{}) ]) def test_finish(self): self.filter.finish() self.assertEqual(self.tf.method_calls,[ ('finish',(),{}) ])