Reconnect before mochad switch send command (#11296)

* Connection to mochad occasionally stalls on RPi and CM19A. Reconnect one switch send command.

* Formatting and exception hanling fixes

* Moved import inside the method. Logging outside the try-catch.

* Tailing whitespaces.

* MockDependency on pymochad in unit tests to resolve exceptions

* patch pymochad MochadException in unit tests to resolve exceptions

* patch pymochad MochadException in unit tests to resolve exceptions

* cleaned unused import

* lint issue fixed

* pylint issue fixed
This commit is contained in:
Alex Osadchyy 2018-01-07 23:32:24 -08:00 committed by Martin Hjelmare
parent 8c0035c5b3
commit 2ba9d825a0
2 changed files with 33 additions and 7 deletions

View file

@ -16,6 +16,7 @@ def pymochad_mock():
"""Mock pymochad."""
with mock.patch.dict('sys.modules', {
'pymochad': mock.MagicMock(),
'pymochad.exceptions': mock.MagicMock(),
}):
yield