Refs #293 - Ensured Dataset can be pickled/unpickled without damages

This commit is contained in:
Claude Paroz
2019-12-30 16:23:38 +01:00
committed by GitHub
parent 00d8ab0b37
commit 0ea6d706a9
+5
View File
@@ -476,6 +476,11 @@ class TablibTestCase(BaseTestCase):
self.founders.append(('Old', 'Man', 100500))
self.assertEqual('first_name|last_name |gpa ', str(self.founders).split('\n')[0])
def test_pickle_unpickle_dataset(self):
before_pickle = self.founders.export('json')
founders = pickle.loads(pickle.dumps(self.founders))
self.assertEqual(founders.export('json'), before_pickle)
def test_databook_add_sheet_accepts_only_dataset_instances(self):
class NotDataset:
def append(self, item):