Add tags support using include options 21/53321/1
authormrichomme <morgan.richomme@orange.com>
Thu, 8 Mar 2018 15:23:38 +0000 (16:23 +0100)
committermrichomme <morgan.richomme@orange.com>
Thu, 8 Mar 2018 15:24:25 +0000 (16:24 +0100)
Change-Id: Ibfd8645e2ec7da7d05ae806b5bc1f5a90bfc39a2
Signed-off-by: mrichomme <morgan.richomme@orange.com>
xtesting/core/robotframework.py
xtesting/tests/unit/core/test_robotframework.py

index cc6020a..007b962 100644 (file)
@@ -96,6 +96,7 @@ class RobotFramework(testcase.TestCase):
             suites = kwargs["suites"]
             variable = kwargs.get("variable", [])
             variablefile = kwargs.get("variablefile", [])
+            include = kwargs.get("include", [])
         except KeyError:
             self.__logger.exception("Mandatory args were not passed")
             return self.EX_RUN_ERROR
@@ -110,7 +111,7 @@ class RobotFramework(testcase.TestCase):
             return self.EX_RUN_ERROR
         stream = StringIO()
         robot.run(*suites, variable=variable, variablefile=variablefile,
-                  output=self.xml_file, log='NONE',
+                  include=include, output=self.xml_file, log='NONE',
                   report='NONE', stdout=stream)
         self.__logger.info("\n" + stream.getvalue())
         self.__logger.info("Results were successfully generated")
index 93111f3..e01ada2 100644 (file)
@@ -118,6 +118,7 @@ class RunTesting(unittest.TestCase):
     suites = ["foo"]
     variable = []
     variablefile = []
+    include = []
 
     def setUp(self):
         self.test = robotframework.RobotFramework(
@@ -132,7 +133,7 @@ class RunTesting(unittest.TestCase):
             self.assertEqual(
                 self.test.run(
                     suites=self.suites, variable=self.variable,
-                    variablefile=self.variablefile),
+                    variablefile=self.variablefile, include=self.include),
                 self.test.EX_RUN_ERROR)
             args[0].assert_not_called()
             mock_method.asser_not_called()
@@ -156,7 +157,7 @@ class RunTesting(unittest.TestCase):
             args[0].assert_called_once_with(
                 *self.suites, log='NONE', output=self.test.xml_file,
                 report='NONE', stdout=mock.ANY, variable=self.variable,
-                variablefile=self.variablefile)
+                variablefile=self.variablefile, include=self.include)
             mock_method.assert_called_once_with()
 
     @mock.patch('os.makedirs', side_effect=OSError(errno.EEXIST, ''))
@@ -175,12 +176,12 @@ class RunTesting(unittest.TestCase):
         self.assertEqual(
             self.test.run(
                 suites=self.suites, variable=self.variable,
-                variablefile=self.variablefile),
+                variablefile=self.variablefile, include=self.include),
             status)
         args[0].assert_called_once_with(
             *self.suites, log='NONE', output=self.test.xml_file,
             report='NONE', stdout=mock.ANY, variable=self.variable,
-            variablefile=self.variablefile)
+            variablefile=self.variablefile, include=self.include)
         args[1].assert_called_once_with(self.test.res_dir)
 
     def test_parse_results_exc(self):