예제 #1
0
 def test_build(self):
   p1 = FlowProperty(mode1='a', mode2='b')
   p2 = FlowProperty(mode1='A', mode3='C')
   job = FlowJob('foo', 'mode1')
   with temppath() as tpath:
     job.build(path=tpath)
     eq_(read_properties(tpath), {
       'type': 'flow',
       'flow.name': 'foo',
       'flow.property.0': 'a',
       'flow.property.1': 'A',
     })
예제 #2
0
 def test_build(self):
     p1 = FlowProperty(mode1='a', mode2='b')
     p2 = FlowProperty(mode1='A', mode3='C')
     job = FlowJob('foo', 'mode1')
     with temppath() as tpath:
         job.build(path=tpath)
         eq_(
             read_properties(tpath), {
                 'type': 'flow',
                 'flow.name': 'foo',
                 'flow.property.0': 'a',
                 'flow.property.1': 'A',
             })
예제 #3
0
파일: __main__.py 프로젝트: dfdx/azkaban
def _parse_option(_option):
  """Parse `--option` argument.

  :param _option: `--option` argument.

  Returns a dictionary.

  """
  paths = (opt for opt in _option if not '=' in opt)
  opts = read_properties(*paths)
  try:
    opts.update(dict(s.split('=', 1) for s in _option if '=' in s))
  except ValueError:
    raise AzkabanError('Invalid `--option` flag.')
  return opts
예제 #4
0
def _parse_option(_option):
  """Parse `--option` argument.

  :param _option: `--option` argument.

  Returns a dictionary.

  """
  paths = (opt for opt in _option if not '=' in opt)
  opts = read_properties(*paths)
  try:
    opts.update(dict(s.split('=', 1) for s in _option if '=' in s))
  except ValueError:
    raise AzkabanError('Invalid `--option` flag.')
  return opts
예제 #5
0
 def test_str(self):
   job = Job({'foo': {'bar': FlowProperty(mode1='a', mode2='b')}})
   with temppath() as tpath:
     job.build(path=tpath)
     eq_(read_properties(tpath), {'foo.bar': '${flow.property.0}'})
예제 #6
0
 def test_str(self):
     job = Job({'foo': {'bar': FlowProperty(mode1='a', mode2='b')}})
     with temppath() as tpath:
         job.build(path=tpath)
         eq_(read_properties(tpath), {'foo.bar': '${flow.property.0}'})