def test_task_result_to_rpc_empty_cipd_pins_packages(self):
     message_conversion.task_result_to_rpc(
         task_result.TaskResultSummary(
             key=ndb.Key('TaskResultSummary',
                         1,
                         parent=ndb.Key('TaskRequest', 0x7fffffffff447fde)),
             cipd_pins=task_result.CipdPins()), False)
Esempio n. 2
0
def _gen_task_result_summary(now, key_id, properties=None, **kwargs):
    """Creates a TaskRequest."""
    props = {
        'command': [u'command1'],
        'dimensions': {
            u'pool': u'default'
        },
        'env': {},
        'execution_timeout_secs': 24 * 60 * 60,
        'io_timeout_secs': None,
    }
    props.update(properties or {})
    args = {
        'created_ts': now,
        'modified_ts': now,
        'name': 'Request name',
        'tags': [u'tag:1'],
        'user': '******',
        'key': ndb.Key('TaskResultSummary', key_id),
    }
    args.update(kwargs)
    return task_result.TaskResultSummary(**args)