summaryrefslogtreecommitdiffstats
path: root/unit_tests
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2016-10-26 09:41:19 +0200
committerMorgan Richomme <morgan.richomme@orange.com>2016-11-04 12:22:07 +0000
commitd3042a7aa885d7761289661fb728f4d7b5e7c94b (patch)
treea51364c06ea2db19a7e3b64b36160bd67b3d127c /unit_tests
parent82f18a401cee8c6f4a2395c6185052c2fcd0ba16 (diff)
Delete the reachability tests
It removes 001__reachability.robot as it is now part of OpenDaylight integration/test. It completes the commit which pushes upstream the reachability tests [1]. [1] https://git.opendaylight.org/gerrit/#/c/46910/ Change-Id: I72926cd4ab77e12ba4aeabf03bdd35619d43ffd3 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'unit_tests')
-rw-r--r--unit_tests/odl/test_odl.py65
1 files changed, 13 insertions, 52 deletions
diff --git a/unit_tests/odl/test_odl.py b/unit_tests/odl/test_odl.py
index 76732593e..cbe4df686 100644
--- a/unit_tests/odl/test_odl.py
+++ b/unit_tests/odl/test_odl.py
@@ -43,19 +43,6 @@ class ODLTestCasesTesting(unittest.TestCase):
os.environ["OS_TENANT_NAME"] = self._os_tenantname
self.test = OpenDaylightTesting.ODLTestCases()
- @mock.patch('shutil.copy', side_effect=Exception())
- def test_copy_opnf_testcases_exception(self, *args):
- with self.assertRaises(Exception):
- self.test.copy_opnf_testcases()
-
- @mock.patch('shutil.copy', side_effect=IOError())
- def test_copy_opnf_testcases_ioerror(self, *args):
- self.assertFalse(self.test.copy_opnf_testcases())
-
- @mock.patch('shutil.copy')
- def test_copy_opnf_testcases(self, *args):
- self.assertTrue(self.test.copy_opnf_testcases())
-
@mock.patch('fileinput.input', side_effect=Exception())
def test_set_robotframework_vars_failed(self, *args):
self.assertFalse(self.test.set_robotframework_vars())
@@ -159,57 +146,41 @@ class ODLTestCasesTesting(unittest.TestCase):
def test_main_missing_odlrestconfport(self):
self._test_main_missing_keyword('odlrestconfport')
- def test_main_copy_opnf_testcases_failed(self):
- with mock.patch.object(self.test, 'copy_opnf_testcases',
- return_value=False):
- self._test_main(TestCasesBase.TestCasesBase.EX_RUN_ERROR)
- self.test.copy_opnf_testcases.assert_called_once_with()
-
def test_main_set_robotframework_vars_failed(self):
- with mock.patch.object(self.test, 'copy_opnf_testcases',
- return_value=True), \
- mock.patch.object(self.test, 'set_robotframework_vars',
- return_value=False):
+ with mock.patch.object(self.test, 'set_robotframework_vars',
+ return_value=False):
self._test_main(TestCasesBase.TestCasesBase.EX_RUN_ERROR)
self.test.set_robotframework_vars.assert_called_once_with(
self._odl_username, self._odl_password)
@mock.patch('os.makedirs', side_effect=Exception)
def test_main_makedirs_exception(self, mock_method):
- with mock.patch.object(self.test,
- 'copy_opnf_testcases', return_value=True), \
- mock.patch.object(self.test, 'set_robotframework_vars',
- return_value=True), \
+ with mock.patch.object(self.test, 'set_robotframework_vars',
+ return_value=True), \
self.assertRaises(Exception):
self._test_main(TestCasesBase.TestCasesBase.EX_RUN_ERROR,
mock_method)
@mock.patch('os.makedirs', side_effect=OSError)
def test_main_makedirs_oserror(self, mock_method):
- with mock.patch.object(self.test,
- 'copy_opnf_testcases', return_value=True), \
- mock.patch.object(self.test, 'set_robotframework_vars',
- return_value=True):
+ with mock.patch.object(self.test, 'set_robotframework_vars',
+ return_value=True):
self._test_main(TestCasesBase.TestCasesBase.EX_RUN_ERROR,
mock_method)
@mock.patch('robot.run', side_effect=RobotError)
@mock.patch('os.makedirs')
def test_main_robot_run_failed(self, *args):
- with mock.patch.object(self.test, 'copy_opnf_testcases',
+ with mock.patch.object(self.test, 'set_robotframework_vars',
return_value=True), \
- mock.patch.object(self.test, 'set_robotframework_vars',
- return_value=True), \
self.assertRaises(RobotError):
self._test_main(TestCasesBase.TestCasesBase.EX_RUN_ERROR, *args)
@mock.patch('robot.run')
@mock.patch('os.makedirs')
def test_main_parse_results_failed(self, *args):
- with mock.patch.object(self.test, 'copy_opnf_testcases',
+ with mock.patch.object(self.test, 'set_robotframework_vars',
return_value=True), \
- mock.patch.object(self.test, 'set_robotframework_vars',
- return_value=True), \
mock.patch.object(self.test, 'parse_results',
side_effect=RobotError):
self._test_main(TestCasesBase.TestCasesBase.EX_RUN_ERROR, *args)
@@ -218,10 +189,8 @@ class ODLTestCasesTesting(unittest.TestCase):
@mock.patch('robot.run')
@mock.patch('os.makedirs')
def test_main_remove_exception(self, *args):
- with mock.patch.object(self.test, 'copy_opnf_testcases',
+ with mock.patch.object(self.test, 'set_robotframework_vars',
return_value=True), \
- mock.patch.object(self.test, 'set_robotframework_vars',
- return_value=True), \
mock.patch.object(self.test, 'parse_results'), \
self.assertRaises(Exception):
self._test_main(TestCasesBase.TestCasesBase.EX_OK, *args)
@@ -230,10 +199,8 @@ class ODLTestCasesTesting(unittest.TestCase):
@mock.patch('robot.run')
@mock.patch('os.makedirs')
def test_main(self, *args):
- with mock.patch.object(self.test, 'copy_opnf_testcases',
+ with mock.patch.object(self.test, 'set_robotframework_vars',
return_value=True), \
- mock.patch.object(self.test, 'set_robotframework_vars',
- return_value=True), \
mock.patch.object(self.test, 'parse_results'):
self._test_main(TestCasesBase.TestCasesBase.EX_OK, *args)
@@ -241,10 +208,8 @@ class ODLTestCasesTesting(unittest.TestCase):
@mock.patch('robot.run')
@mock.patch('os.makedirs', side_effect=OSError(errno.EEXIST, ''))
def test_main_makedirs_oserror17(self, *args):
- with mock.patch.object(self.test, 'copy_opnf_testcases',
+ with mock.patch.object(self.test, 'set_robotframework_vars',
return_value=True), \
- mock.patch.object(self.test, 'set_robotframework_vars',
- return_value=True), \
mock.patch.object(self.test, 'parse_results'):
self._test_main(TestCasesBase.TestCasesBase.EX_OK, *args)
@@ -252,10 +217,8 @@ class ODLTestCasesTesting(unittest.TestCase):
@mock.patch('robot.run', return_value=1)
@mock.patch('os.makedirs')
def test_main_testcases_in_failure(self, *args):
- with mock.patch.object(self.test, 'copy_opnf_testcases',
+ with mock.patch.object(self.test, 'set_robotframework_vars',
return_value=True), \
- mock.patch.object(self.test, 'set_robotframework_vars',
- return_value=True), \
mock.patch.object(self.test, 'parse_results'):
self._test_main(TestCasesBase.TestCasesBase.EX_OK, *args)
@@ -263,10 +226,8 @@ class ODLTestCasesTesting(unittest.TestCase):
@mock.patch('robot.run')
@mock.patch('os.makedirs')
def test_main_remove_oserror(self, *args):
- with mock.patch.object(self.test, 'copy_opnf_testcases',
+ with mock.patch.object(self.test, 'set_robotframework_vars',
return_value=True), \
- mock.patch.object(self.test, 'set_robotframework_vars',
- return_value=True), \
mock.patch.object(self.test, 'parse_results'):
self._test_main(TestCasesBase.TestCasesBase.EX_OK, *args)