class TestPybotArgumentsValidation(unittest.TestCase):
    def setUp(self):
        self._profile = PybotProfile(lambda: 0)

    def test_invalid_argument(self):
        self.assertNotEqual(
            None, self._profile._get_invalid_message('--invalidargument'))

    def test_valid_argument_short(self):
        self._working_arguments('-T')

    def _working_arguments(self, args):
        self.assertEqual(None, self._profile._get_invalid_message(args))

    def test_valid_argument_long(self):
        self._working_arguments('--timestampoutputs')

    def test_valid_argument_with_value(self):
        self._working_arguments('--log somelog.html')

    def test_runfailed_argument_works(self):
        self._working_arguments('--runfailed output.xml')

    def test_old_runmode_argument_works(self):
        self._working_arguments('--runmode DryRun')
Ejemplo n.º 2
0
class TestPybotArgumentsValidation(unittest.TestCase):
    def setUp(self):
        self._profile = PybotProfile(lambda: 0)

    @unittest.expectedFailure  # No more DataError, better argument detection
    def test_invalid_argument(self):
        try:
            self.assertRaisesRegex(robot.errors.DataError,
                                   'option --invalidargument not recognized',
                                   self._profile._get_invalid_message,
                                   '--invalidargument')
        except AttributeError:  # Python2
            self.assertRaisesRegexp(robot.errors.DataError,
                                    'option --invalidargument not recognized',
                                    self._profile._get_invalid_message,
                                    '--invalidargument')

    def test_valid_argument_short(self):
        self._working_arguments('-T')

    def _working_arguments(self, args):
        self.assertEqual(None, self._profile._get_invalid_message(args))

    def test_valid_argument_long(self):
        self._working_arguments('--timestampoutputs')

    def test_valid_argument_with_value(self):
        self._working_arguments('--log somelog.html')

    def test_runfailed_argument_works(self):
        self._working_arguments('--runfailed output.xml')
Ejemplo n.º 3
0
class TestPybotArgumentsValidation(unittest.TestCase):

    def setUp(self):
        self._profile = PybotProfile(lambda: 0)

    def test_invalid_argument(self):

        self.assertRaisesRegex(robotide.lib.robot.errors.DataError,
                               'option --invalidargument not recognized',
                               self._profile._get_invalid_message,
                               '--invalidargument')

    def test_valid_argument_short(self):
        self._working_arguments('-T')

    def _working_arguments(self, args):
        self.assertEqual(None, self._profile._get_invalid_message(args))

    def test_valid_argument_long(self):
        self._working_arguments('--timestampoutputs')

    def test_valid_argument_with_value(self):
        self._working_arguments('--log somelog.html')

    def test_runfailed_argument_works(self):
        self._working_arguments('--rerunfailed output.xml')
class TestPybotArgumentsValidation(unittest.TestCase):

    def setUp(self):
        self._profile = PybotProfile(lambda:0)

    @unittest.expectedFailure   # No more DataError, better argument detection
    def test_invalid_argument(self):
        try:
            self.assertRaisesRegex(robotide.lib.robot.errors.DataError,
                                   'option --invalidargument not recognized',
                                   self._profile._get_invalid_message,
                                   '--invalidargument')
        except AttributeError:  # Python2
            self.assertRaisesRegexp(robotide.lib.robot.errors.DataError,
                                    'option --invalidargument not recognized',
                                    self._profile._get_invalid_message,
                                    '--invalidargument')

    def test_valid_argument_short(self):
        self._working_arguments('-T')

    def _working_arguments(self, args):
        self.assertEqual(None, self._profile._get_invalid_message(args))

    def test_valid_argument_long(self):
        self._working_arguments('--timestampoutputs')

    def test_valid_argument_with_value(self):
        self._working_arguments('--log somelog.html')

    def test_runfailed_argument_works(self):
        self._working_arguments('--rerunfailed output.xml')
Ejemplo n.º 5
0
class TestPybotArgumentsValidation(unittest.TestCase):

    def setUp(self):
        self._profile = PybotProfile(lambda:0)

    def test_invalid_argument(self):
        self.assertNotEqual(None, self._profile._get_invalid_message('--invalidargument'))

    def test_valid_argument_short(self):
        self._working_arguments('-T')

    def _working_arguments(self, args):
        self.assertEqual(None, self._profile._get_invalid_message(args))

    def test_valid_argument_long(self):
        self._working_arguments('--timestampoutputs')

    def test_valid_argument_with_value(self):
        self._working_arguments('--log somelog.html')

    def test_runfailed_argument_works(self):
        self._working_arguments('--runfailed output.xml')
Ejemplo n.º 6
0
 def setUp(self):
     self._profile = PybotProfile(lambda:0)
Ejemplo n.º 7
0
 def setUp(self):
     self._profile = PybotProfile(lambda: 0)