Example #1
0
def test_multiple_dict():
    mr = MultipleResults.from_dict({
        'output_one': 'value_one',
        'output_two': 'value_two'
    })
    assert set(mr.results) == set(
        [Result('value_one', 'output_one'),
         Result('value_two', 'output_two')])
Example #2
0
 def hello_world(_info):
     return MultipleResults.from_dict({
         'left': {
             'foo': 'left'
         },
         'right': {
             'foo': 'right'
         }
     })
Example #3
0
 def solid_fn(info, **_kwargs):
     for i in range(200):
         time.sleep(0.02)
         if i % 1000 == 420:
             info.log.error(
                 'Error message seq={i} from solid {name}'.format(
                     i=i, name=name))
         elif i % 100 == 0:
             info.log.warning(
                 'Warning message seq={i} from solid {name}'.format(
                     i=i, name=name))
         elif i % 10 == 0:
             info.log.info('Info message seq={i} from solid {name}'.format(
                 i=i, name=name))
         else:
             info.log.debug(
                 'Debug message seq={i} from solid {name}'.format(
                     i=i, name=name))
     return MultipleResults.from_dict(
         {'output_{}'.format(i): 'foo'
          for i in range(n_outputs)})
Example #4
0
def return_dict_results(_info):
    return MultipleResults.from_dict({'out_one': 23, 'out_two': 45})