Ejemplo n.º 1
0
    def _assertArgumentPatternFails(argumentPattern=None):
      if argumentPattern is None:
        argumentPattern = []

      argumentPattern = ["unicorn_backend/model_runner_2.py"] + argumentPattern

      with patch.object(sys, "argv", argumentPattern):
        # pylint: disable=W0212
        with self.assertRaises(model_runner_2._CommandLineArgError):
          model_runner_2._parseArgs()
Ejemplo n.º 2
0
    def _assertArgumentPatternFails(argumentPattern=None,
                                    excSubstring=None):
      if argumentPattern is None:
        argumentPattern = []

      argumentPattern = ["unicorn_backend/model_runner_2.py"] + argumentPattern

      with patch.object(sys, "argv", argumentPattern):
        # pylint: disable=W0212
        with self.assertRaises(model_runner_2._CommandLineArgError) as excCtx:
          model_runner_2._parseArgs()

        if excSubstring is not None:
          self.assertIn(excSubstring, str(excCtx.exception))
        def _assertArgumentPatternFails(argumentPattern=None,
                                        excSubstring=None):
            if argumentPattern is None:
                argumentPattern = []

            argumentPattern = ["unicorn_backend/model_runner_2.py"
                               ] + argumentPattern

            with patch.object(sys, "argv", argumentPattern):
                # pylint: disable=W0212
                with self.assertRaises(
                        model_runner_2._CommandLineArgError) as excCtx:
                    model_runner_2._parseArgs()

                if excSubstring is not None:
                    self.assertIn(excSubstring, str(excCtx.exception))