diff options
author | Paul Vinciguerra <pvinci@vinciconsulting.com> | 2018-11-25 16:09:26 -0800 |
---|---|---|
committer | Ole Trøan <otroan@employees.org> | 2019-02-26 09:38:12 +0000 |
commit | 1e18eb20c34d2b5e3b815c34831a78a14af98259 (patch) | |
tree | 3e7bab8c6c9376b3f9ef1a225f1ad1f5594e170b /test/test_ip6.py | |
parent | 9338fc644da4e1d9d9ac9f1e3886f555918026f8 (diff) |
VPP-1508 python tests: unicode
Change unicode references to use text_type
Change-Id: Ia71c16e3235bc509abd3b1c651ae125f892ab108
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'test/test_ip6.py')
-rw-r--r-- | test/test_ip6.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/test/test_ip6.py b/test/test_ip6.py index 6793c8b0d94..6832498dc26 100644 --- a/test/test_ip6.py +++ b/test/test_ip6.py @@ -30,6 +30,11 @@ from ipaddress import IPv6Network, IPv4Network AF_INET6 = socket.AF_INET6 +try: + text_type = unicode +except NameError: + text_type = str + def mk_ll_addr(mac): euid = in6_mactoifaceid(mac) @@ -1060,9 +1065,9 @@ class TestIPv6RD(TestIPv6ND): def verify_prefix_info(self, reported_prefix, prefix_option): prefix = IPv6Network( - unicode(prefix_option.getfieldval("prefix") + - "/" + - str(prefix_option.getfieldval("prefixlen"))), + text_type(prefix_option.getfieldval("prefix") + + "/" + + text_type(prefix_option.getfieldval("prefixlen"))), strict=False) self.assert_equal(reported_prefix.prefix.network_address, prefix.network_address) |