clients/tests: test nmcli con mod command with different locale

Just to give it some variety. Also, note how the message from the
server cannot be translated. Which is the case with real NetworkManager
as well, and is a major usability issue.
This commit is contained in:
Thomas Haller 2018-06-05 11:26:03 +02:00
parent f3dddcff2a
commit 360f952399
3 changed files with 5 additions and 5 deletions

View file

@ -1,13 +1,13 @@
location: clients/tests/test-client.py:812:test_004()/3
cmd: $NMCLI connection mod con-xx1 ipv4.gateway 172.16.0.1
lang: C
lang: pl_PL.UTF-8
returncode: 1
stdout: 0 bytes
>>>
<<<
stderr: 119 bytes
stderr: 143 bytes
>>>
Error: Failed to modify connection 'con-xx1': ipv4.gateway: gateway cannot be set if there are no addresses configured
Błąd: zmodyfikowanie połączenia „con-xx1” się nie powiodło: ipv4.gateway: gateway cannot be set if there are no addresses configured
<<<

View file

@ -809,7 +809,7 @@ class TestNmcli(NmTestBase):
replace_stdout = replace_stdout)
self.call_nmcli(['connection', 'mod', 'con-xx1', 'ip.gateway', ''])
self.call_nmcli(['connection', 'mod', 'con-xx1', 'ipv4.gateway', '172.16.0.1'])
self.call_nmcli(['connection', 'mod', 'con-xx1', 'ipv4.gateway', '172.16.0.1'], lang = 'pl')
self.call_nmcli(['connection', 'mod', 'con-xx1', 'ipv6.gateway', '::99'])
self.call_nmcli(['connection', 'mod', 'con-xx1', '802.abc', ''])
self.call_nmcli(['connection', 'mod', 'con-xx1', '802-11-wireless.band', 'a'])

View file

@ -109,7 +109,7 @@ class Util:
if val.signature == 'au':
return GLib.Variant('aau', [Util.variant_from_dbus(x) for x in val])
if val.signature == 'a{sv}':
return GLib.Variant('aa{sv}', [(str(k), Util.variant_from_dbus(v)) for k, v in val])
return GLib.Variant('aa{sv}', [collections.OrderedDict([(str(k), Util.variant_from_dbus(v)) for k, v in addr.items()]) for addr in val])
if val.signature == '(ayuay)':
return GLib.Variant('a(ayuay)', [Util.variant_from_dbus(x) for x in val])
if val.signature == '(ayuayu)':