Пример #1
0
 def make_view(self):
     device = mock.create_autospec(spec=Networkdev)
     device.configured_ip_addresses_for_version = lambda v: []
     base_view = BaseView(urwid.Text(""))
     base_view.update_link = lambda device: None
     stretchy = EditNetworkStretchy(base_view, device, 4)
     base_view.show_stretchy_overlay(stretchy)
     stretchy.method_form.method.value = "manual"
     return base_view, stretchy
 def make_view(self):
     device = mock.create_autospec(spec=NetworkDev)
     device.config = {}
     base_view = BaseView(urwid.Text(""))
     base_view.update_link = lambda device: None
     base_view.controller = mock.create_autospec(spec=NetworkController)
     stretchy = EditNetworkStretchy(base_view, device, 4)
     base_view.show_stretchy_overlay(stretchy)
     stretchy.method_form.method.value = "manual"
     return base_view, stretchy
Пример #3
0
 def make_view(self, dev_info=None):
     if dev_info is None:
         dev_info = create_test_instance(
             NetDevInfo, overrides={'static4.addresses': ['1.2.3.4/5']})
     base_view = BaseView(urwid.Text(""))
     base_view.update_link = lambda device: None
     base_view.controller = mock.create_autospec(spec=NetworkController)
     stretchy = EditNetworkStretchy(base_view, dev_info, 4)
     base_view.show_stretchy_overlay(stretchy)
     stretchy.method_form.method.value = "manual"
     return base_view, stretchy