parent
9036103102
commit
e6149b09ce
@ -248,7 +248,9 @@ class QubesBase(qubesadmin.base.PropertyHolder):
|
|||||||
if not isinstance(cls, str):
|
if not isinstance(cls, str):
|
||||||
cls = cls.__name__
|
cls = cls.__name__
|
||||||
|
|
||||||
if template is not None:
|
if template is qubesadmin.DEFAULT:
|
||||||
|
template = None
|
||||||
|
elif template is not None:
|
||||||
template = str(template)
|
template = str(template)
|
||||||
|
|
||||||
if pool and pools:
|
if pool and pools:
|
||||||
|
@ -148,6 +148,17 @@ class TC_10_QubesBase(qubesadmin.tests.QubesTestCase):
|
|||||||
self.assertEqual(vm.__class__.__name__, 'AppVM')
|
self.assertEqual(vm.__class__.__name__, 'AppVM')
|
||||||
self.assertAllCalled()
|
self.assertAllCalled()
|
||||||
|
|
||||||
|
def test_016_new_template_based_default(self):
|
||||||
|
self.app.expected_calls[('dom0', 'admin.vm.Create.AppVM',
|
||||||
|
None, b'name=new-vm label=red')] = b'0\x00'
|
||||||
|
self.app.expected_calls[('dom0', 'admin.vm.List', None, None)] = \
|
||||||
|
b'0\x00new-vm class=AppVM state=Running\n'
|
||||||
|
vm = self.app.add_new_vm('AppVM', 'new-vm', 'red',
|
||||||
|
template=qubesadmin.DEFAULT)
|
||||||
|
self.assertEqual(vm.name, 'new-vm')
|
||||||
|
self.assertEqual(vm.__class__.__name__, 'AppVM')
|
||||||
|
self.assertAllCalled()
|
||||||
|
|
||||||
def test_020_get_label(self):
|
def test_020_get_label(self):
|
||||||
self.app.expected_calls[('dom0', 'admin.label.List', None, None)] = \
|
self.app.expected_calls[('dom0', 'admin.label.List', None, None)] = \
|
||||||
b'0\x00red\nblue\n'
|
b'0\x00red\nblue\n'
|
||||||
|
Loading…
Reference in New Issue
Block a user