[VOL-2241] Python 3 refactor of pyvoltha
Majority of work was manual fixes to bytes and strings types, which are
different in py3, but same in py2. As the OMCI library does a lot of
these comparisons and scapy then renders packets, this was frequently
nontrival to debug.
Also:
- Removed grpc dep which wasn't being used, not py3 compatible
- s/Alarms/Events/ to work with protobuf changes per VOL-2224
- Automatic fixes via modernize tooling
- Removed unused OrderedWeakValueDict code
- Removed frameio send_frame specific to Darwin (MacOS), which had no
corresponding linux code
- Use library functions for hex and unicode conversions
- Various other cleanups and fixes (EOL whitespace, etc.)
Also more (Matt):
- handle stringify better, check if already string
- use binary string for binary work
- import new thread paths
- update requirements.txt for newer libraries needed with newer python
- return proper tuple for unpacking
- bytes string formatting fixed
- fix mock task unit test
Even more (Zack):
- Python 2/3 compat for _thread by using 'future'
- Bump version to 2.3.0
Change-Id: I53b596d374a944bfb80d0b112f21bcc1f8bcee6e
diff --git a/test/unit/extensions/omci/test_omci_cc.py b/test/unit/extensions/omci/test_omci_cc.py
index 992ba2b..7fee9ae 100644
--- a/test/unit/extensions/omci/test_omci_cc.py
+++ b/test/unit/extensions/omci/test_omci_cc.py
@@ -13,20 +13,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
+from __future__ import absolute_import
import binascii
from pyvoltha.adapters.common.frameio.frameio import hexify
from twisted.python.failure import Failure
from unittest import TestCase, main, skip
-from mock.mock_adapter_agent import MockAdapterAgent
-from mock.mock_onu_handler import MockOnuHandler
-from mock.mock_olt_handler import MockOltHandler
-from mock.mock_onu import MockOnu
+from .mock.mock_adapter_agent import MockAdapterAgent
+from .mock.mock_onu_handler import MockOnuHandler
+from .mock.mock_olt_handler import MockOltHandler
+from .mock.mock_onu import MockOnu
from pyvoltha.adapters.extensions.omci.omci_defs import *
from pyvoltha.adapters.extensions.omci.omci_frame import *
from pyvoltha.adapters.extensions.omci.omci_entities import *
from pyvoltha.adapters.extensions.omci.omci_me import ExtendedVlanTaggingOperationConfigurationDataFrame
from pyvoltha.adapters.extensions.omci.omci_cc import OMCI_CC, UNKNOWN_CLASS_ATTRIBUTE_KEY,\
MAX_OMCI_REQUEST_AGE
+from six.moves import range
DEFAULT_OLT_DEVICE_ID = 'default_olt_mock'
DEFAULT_ONU_DEVICE_ID = 'default_onu_mock'
@@ -838,7 +840,6 @@
self.assertEqual(expected, val)
return results
- @skip('for unknown omci failure')
#@deferred()
def test_rx_table_get_extvlantagging(self):
self.setup_one_of_each()