Closed yuangezhizao closed 2 years ago
All unittest passed in Python 3.5
and Python 3.6
environment, but waiting for fix in Python 2.7
environment.
There are two types of errors in Python 2.7
environment.
======================================================================
ERROR: test_l2vpn_evpn_parse_route_type2 (yabgp.tests.unit.message.attribute.test_mpreachnlri.TestMpReachNLRI)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/runner/work/yabgp/yabgp/yabgp/tests/unit/message/attribute/test_mpreachnlri.py", line 202, in test_l2vpn_evpn_parse_route_type2
self.assertEqual(data_dict, MpReachNLRI.parse(data_bin[3:]))
File "/Users/runner/work/yabgp/yabgp/yabgp/message/attribute/mpreachnlri.py", line 195, in parse
nlri = EVPN.parse(nlri_bin)
File "/Users/runner/work/yabgp/yabgp/yabgp/message/attribute/nlri/evpn.py", line 51, in parse
route = MacIPAdvertisment.parse(route_value)
File "/Users/runner/work/yabgp/yabgp/yabgp/message/attribute/nlri/evpn.py", line 294, in parse
route['esi'] = cls.parse_esi(value[offset: offset + 10])
File "/Users/runner/work/yabgp/yabgp/yabgp/message/attribute/nlri/evpn.py", line 156, in parse_esi
esi_value = int.from_bytes(esi[1:], byteorder='big')
AttributeError: type object 'int' has no attribute 'from_bytes'
======================================================================
ERROR: yabgp.tests.unit.message.test_update (unittest.loader.ModuleImportFailure)
----------------------------------------------------------------------
ImportError: Failed to import test module: yabgp.tests.unit.message.test_update
Traceback (most recent call last):
File "/Users/runner/hostedtoolcache/Python/2.7.18/x64/lib/python2.7/unittest/loader.py", line 254, in _find_tests
module = self._get_module_from_name(name)
File "/Users/runner/hostedtoolcache/Python/2.7.18/x64/lib/python2.7/unittest/loader.py", line 232, in _get_module_from_name
__import__(name)
File "/Users/runner/work/yabgp/yabgp/yabgp/tests/unit/message/test_update.py", line 218
SyntaxError: Non-ASCII character '\xe2' in file /Users/runner/work/yabgp/yabgp/yabgp/tests/unit/message/test_update.py on line 218, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
The unittest error in the Python 2.7
environment has been fixed by @xinmos, now also passed.
TBR
Python 2.7
Python 3.5
Python 3.6