def test_after_op(self):
   """Test duplicate ops."""
   with Pipeline('somename') as p:
     op1 = ContainerOp(name='op1', image='image')
     op2 = ContainerOp(name='op2', image='image')
     op2.after(op1)
   self.assertCountEqual(op2.dependent_op_names, [op1.name])
Example #2
0
 def test_invalid_exit_op(self):
     with self.assertRaises(ValueError):
         with Pipeline('somename') as p:
             op1 = ContainerOp(name='op1', image='image')
             exit_op = ContainerOp(name='exit', image='image')
             exit_op.after(op1)
             with ExitHandler(exit_op=exit_op):
                 pass