1
# Copyright 2014 Canonical Ltd. This software is licensed under the
2
# GNU Affero General Public License version 3 (see the file LICENSE).
4
"""Helpers for boot image rpc testing."""
6
from __future__ import (
16
'make_rpc_boot_image',
19
from maasserver.testing.factory import factory
22
def make_rpc_boot_image(
23
osystem=None, release=None, architecture=None, subarchitecture=None,
24
label=None, purpose=None, xinstall_type=None, xinstall_path=None):
25
"""Return boot image that would be returned from a ListBootImages RPC call.
28
osystem = factory.make_name('os')
30
release = factory.make_name('series')
31
if architecture is None:
32
architecture = factory.make_name('arch')
33
if subarchitecture is None:
34
subarchitecture = factory.make_name('subarch')
36
label = factory.make_name('label')
38
purpose = factory.make_name('purpose')
39
if xinstall_type is None:
40
xinstall_type = factory.make_name('xi_type')
41
if xinstall_path is None:
42
xinstall_path = factory.make_name('xi_path')
46
'architecture': architecture,
47
'subarchitecture': subarchitecture,
50
'xinstall_type': xinstall_type,
51
'xinstall_path': xinstall_path,