libnm/tests: fix handling ByteArray in test-networkmanager-service.py for Python 3
authorThomas Haller <thaller@redhat.com>
Mon, 5 Jan 2015 12:48:39 +0000 (13:48 +0100)
committerThomas Haller <thaller@redhat.com>
Mon, 5 Jan 2015 13:18:47 +0000 (14:18 +0100)
commitc569fc23bfc160acc1cf1d5bce2fffd9f7dd72ef
treecdbf7a271aa0bd10d4a392bad923d98e7d2089de
parent738649c1d5fe28f487cb5158398a0688467d8513
libnm/tests: fix handling ByteArray in test-networkmanager-service.py for Python 3

In Python 3, dbus.ByteArray() must be created using a byte string,
while strings obtained via DBUS are unicode strings.

This was wrong in WifiAp.__get_props() which broke the test
test_wifi_ap_added_removed().

    File "/usr/lib/python3.3/site-packages/dbus/service.py", line 707, in _message_cb
      retval = candidate_method(self, *args, **keywords)
    File "./NetworkManager/tools/test-networkmanager-service.py", line 102, in GetAll
      return self._get_dbus_properties(iface)
    File "./NetworkManager/tools/test-networkmanager-service.py", line 96, in _get_dbus_properties
      return self.__dbus_ifaces[iface]()
    File "./NetworkManager/tools/test-networkmanager-service.py", line 315, in __get_props
      props[PP_SSID] = dbus.ByteArray(self.ssid)
    TypeError: string argument without an encoding

https://bugzilla.gnome.org/show_bug.cgi?id=739448
tools/test-networkmanager-service.py