Add num_first_segment_words argument wherever message creation can occur

This commit is contained in:
Jason Paryani
2014-02-28 13:36:38 -08:00
parent 3231a07c9a
commit cba4378d1f
3 changed files with 36 additions and 16 deletions

View File

@@ -397,6 +397,17 @@ def test_build(all_types):
expectedText = open(os.path.join(this_dir, 'all-types.txt'), 'r').read()
assert str(root) + '\n' == expectedText
def test_build_first_segment_size(all_types):
root = all_types.TestAllTypes.new_message(1)
init_all_types(root)
expectedText = open(os.path.join(this_dir, 'all-types.txt'), 'r').read()
assert str(root) + '\n' == expectedText
root = all_types.TestAllTypes.new_message(1024*1024)
init_all_types(root)
expectedText = open(os.path.join(this_dir, 'all-types.txt'), 'r').read()
assert str(root) + '\n' == expectedText
def test_binary_read(all_types):
f = open(os.path.join(this_dir, 'all-types.binary'), 'r')
root = all_types.TestAllTypes.read(f)