comparison tests/test-bundle2.t @ 21605:f9dabfceb259

bundle2: introduce a ``addparam`` method on part We make it easier to add new parameters after the part creation. As for the ``data`` attribute we make sure the part generation has not begun yet.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 22 May 2014 11:38:40 -0700
parents c399bf961cb9
children 0cfda08afd24
comparison
equal deleted inserted replaced
21604:c399bf961cb9 21605:f9dabfceb259
104 > bundler.newpart('test:empty') 104 > bundler.newpart('test:empty')
105 > # add a second one to make sure we handle multiple parts 105 > # add a second one to make sure we handle multiple parts
106 > bundler.newpart('test:empty') 106 > bundler.newpart('test:empty')
107 > bundler.newpart('test:song', data=ELEPHANTSSONG) 107 > bundler.newpart('test:song', data=ELEPHANTSSONG)
108 > bundler.newpart('test:debugreply') 108 > bundler.newpart('test:debugreply')
109 > bundler.newpart('test:math', 109 > mathpart = bundler.newpart('test:math')
110 > [('pi', '3.14'), ('e', '2.72')], 110 > mathpart.addparam('pi', '3.14')
111 > [('cooking', 'raw')], 111 > mathpart.addparam('e', '2.72')
112 > '42') 112 > mathpart.addparam('cooking', 'raw', mandatory=False)
113 > mathpart.data = '42'
113 > if opts['unknown']: 114 > if opts['unknown']:
114 > bundler.newpart('test:UNKNOWN', data='some random content') 115 > bundler.newpart('test:UNKNOWN', data='some random content')
115 > if opts['parts']: 116 > if opts['parts']:
116 > bundler.newpart('test:ping') 117 > bundler.newpart('test:ping')
117 > 118 >