[core] Still refactoring the core behaviour of bags, starting to be much simpler.

This commit is contained in:
Romain Dorgueil
2017-10-23 21:18:02 +02:00
committed by Romain Dorgueil
parent f18889830b
commit 9a54f7b4aa
22 changed files with 437 additions and 262 deletions

View File

@ -14,7 +14,7 @@ def test_write_pickled_dict_to_file(tmpdir):
fs, filename, services = pickle_tester.get_services_for_writer(tmpdir)
with NodeExecutionContext(PickleWriter(filename), services=services) as context:
context.write_sync(Bag({'foo': 'bar'}), Bag({'foo': 'baz', 'ignore': 'this'}))
context.write_sync(Bag(({'foo': 'bar'}, {})), Bag(({'foo': 'baz', 'ignore': 'this'}, {})))
with fs.open(filename, 'rb') as fp:
assert pickle.loads(fp.read()) == {'foo': 'bar'}
@ -27,7 +27,7 @@ def test_read_pickled_list_from_file(tmpdir):
fs, filename, services = pickle_tester.get_services_for_reader(tmpdir)
with BufferingNodeExecutionContext(PickleReader(filename), services=services) as context:
context.write_sync(Bag())
context.write_sync(())
output = context.get_buffer()
assert len(output) == 2