Example #1
0
def make_format_entire_view(model, disk):
    controller = mock.create_autospec(spec=FilesystemController)
    base_view = BaseView(urwid.Text(""))
    base_view.model = model
    base_view.controller = controller
    base_view.refresh_model_inputs = lambda: None
    stretchy = FormatEntireStretchy(base_view, disk)
    base_view.show_stretchy_overlay(stretchy)
    return base_view, stretchy
Example #2
0
def make_partition_view(model, disk, partition=None):
    controller = mock.create_autospec(spec=FilesystemController)
    base_view = BaseView(urwid.Text(""))
    base_view.model = model
    base_view.controller = controller
    base_view.refresh_model_inputs = lambda: None
    stretchy = PartitionStretchy(base_view, disk, partition)
    base_view.show_stretchy_overlay(stretchy)
    return base_view, stretchy
Example #3
0
def make_view(model, existing=None):
    controller = mock.create_autospec(spec=FilesystemController)
    base_view = BaseView(urwid.Text(""))
    base_view.model = model
    base_view.controller = controller
    base_view.refresh_model_inputs = lambda: None
    stretchy = RaidStretchy(base_view, existing)
    base_view.show_stretchy_overlay(stretchy)
    return base_view, stretchy
Example #4
0
 def make_view(self, partition=None):
     controller = mock.create_autospec(spec=FilesystemController)
     model = mock.create_autospec(spec=FilesystemModel)
     model.fs_by_name = FilesystemModel.fs_by_name
     disk = Disk.from_info(
         FakeStorageInfo(name='disk-name',
                         size=100 * (2**20),
                         free=50 * (2**20)))
     base_view = BaseView(urwid.Text(""))
     base_view.model = model
     base_view.controller = controller
     base_view.refresh_model_inputs = lambda: None
     stretchy = PartitionStretchy(base_view, disk, partition)
     base_view.show_stretchy_overlay(stretchy)
     return base_view, stretchy