@@ -60,8 +60,8 @@ def test_show():
6060IP6.ADDRESS[1]: ::1/128
6161IP6.GATEWAY: --
6262IP6.ROUTE[1]: dst = ::1/128, nh = ::, mt = 256'''
63- s = DummySystemCommand (d )
64- device = DeviceControl (s )
63+ s1 = DummySystemCommand (d )
64+ device = DeviceControl (s1 )
6565 assert device .show ('lo' ) == {
6666 'GENERAL.DEVICE' : 'lo' ,
6767 'GENERAL.TYPE' : 'loopback' ,
@@ -76,7 +76,25 @@ def test_show():
7676 'IP6.GATEWAY' : None ,
7777 'IP6.ROUTE[1]' : 'dst = ::1/128, nh = ::, mt = 256'
7878 }
79- assert s .passed_parameters == ['device' , 'show' , 'lo' ]
79+ assert s1 .passed_parameters == ['device' , 'show' , 'lo' ]
80+
81+ s2 = DummySystemCommand (d )
82+ device = DeviceControl (s2 )
83+ assert device .show ('lo' , 'all' ) == {
84+ 'GENERAL.DEVICE' : 'lo' ,
85+ 'GENERAL.TYPE' : 'loopback' ,
86+ 'GENERAL.HWADDR' : '00:00:00:00:00:00' ,
87+ 'GENERAL.MTU' : '65536' ,
88+ 'GENERAL.STATE' : '10 (unmanaged)' ,
89+ 'GENERAL.CONNECTION' : None ,
90+ 'GENERAL.CON-PATH' : None ,
91+ 'IP4.ADDRESS[1]' : '127.0.0.1/8' ,
92+ 'IP4.GATEWAY' : None ,
93+ 'IP6.ADDRESS[1]' : '::1/128' ,
94+ 'IP6.GATEWAY' : None ,
95+ 'IP6.ROUTE[1]' : 'dst = ::1/128, nh = ::, mt = 256'
96+ }
97+ assert s2 .passed_parameters == ['-f' , 'all' , 'device' , 'show' , 'lo' ]
8098
8199
82100def test_show_all ():
@@ -100,8 +118,8 @@ def test_show_all():
100118IP6.ADDRESS[1]: ::1/128
101119IP6.GATEWAY: --
102120IP6.ROUTE[1]: dst = ::1/128, nh = ::, mt = 256'''
103- s = DummySystemCommand (d )
104- device = DeviceControl (s )
121+ s1 = DummySystemCommand (d )
122+ device = DeviceControl (s1 )
105123 assert device .show_all () == [{
106124 'GENERAL.DEVICE' : 'wlan0' ,
107125 'GENERAL.TYPE' : 'wifi' ,
@@ -124,7 +142,33 @@ def test_show_all():
124142 'IP6.GATEWAY' : None ,
125143 'IP6.ROUTE[1]' : 'dst = ::1/128, nh = ::, mt = 256'
126144 }]
127- assert s .passed_parameters == ['device' , 'show' ]
145+ assert s1 .passed_parameters == ['device' , 'show' ]
146+
147+ s2 = DummySystemCommand (d )
148+ device = DeviceControl (s2 )
149+ assert device .show_all ('all' ) == [{
150+ 'GENERAL.DEVICE' : 'wlan0' ,
151+ 'GENERAL.TYPE' : 'wifi' ,
152+ 'GENERAL.HWADDR' : '46:7B:1F:32:36:E2' ,
153+ 'GENERAL.MTU' : '1500' ,
154+ 'GENERAL.STATE' : '30 (disconnected)' ,
155+ 'GENERAL.CONNECTION' : None ,
156+ 'GENERAL.CON-PATH' : None
157+ }, {
158+ 'GENERAL.DEVICE' : 'lo' ,
159+ 'GENERAL.TYPE' : 'loopback' ,
160+ 'GENERAL.HWADDR' : '00:00:00:00:00:00' ,
161+ 'GENERAL.MTU' : '65536' ,
162+ 'GENERAL.STATE' : '10 (unmanaged)' ,
163+ 'GENERAL.CONNECTION' : None ,
164+ 'GENERAL.CON-PATH' : None ,
165+ 'IP4.ADDRESS[1]' : '127.0.0.1/8' ,
166+ 'IP4.GATEWAY' : None ,
167+ 'IP6.ADDRESS[1]' : '::1/128' ,
168+ 'IP6.GATEWAY' : None ,
169+ 'IP6.ROUTE[1]' : 'dst = ::1/128, nh = ::, mt = 256'
170+ }]
171+ assert s2 .passed_parameters == ['-f' , 'all' , 'device' , 'show' ]
128172
129173
130174def test_connect ():
0 commit comments