SEBA-353 Pull step should be resilient to missing PonPorts;
Delete OLTDevice if Voltha unreachable
Change-Id: I806eaa9f3bdd281ef3184ec5d6e76177199d5cad
diff --git a/xos/synchronizer/steps/test_sync_olt_device.py b/xos/synchronizer/steps/test_sync_olt_device.py
index 18ed99b..38da1a1 100644
--- a/xos/synchronizer/steps/test_sync_olt_device.py
+++ b/xos/synchronizer/steps/test_sync_olt_device.py
@@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+from requests import ConnectionError
import unittest
import functools
from mock import patch, call, Mock, PropertyMock
@@ -339,6 +340,18 @@
self.assertEqual(m.call_count, 2)
+ @patch('requests.post')
+ def test_delete_record_connectionerror(self, m):
+ self.o.of_id = "0001000ce2314000"
+ self.o.device_id = "123"
+
+ m.side_effect = ConnectionError()
+
+ self.sync_step().delete_record(self.o)
+
+ # No exception thrown, as ConnectionError will be caught
+
+
@requests_mock.Mocker()
def test_delete_unsynced_record(self, m):