parent
45ab24ce12
commit
851ba6aedb
@ -25,4 +25,6 @@ class QubesException(Exception):
|
|||||||
'''Base exception for all Qubes-related errors.'''
|
'''Base exception for all Qubes-related errors.'''
|
||||||
def __init__(self, message_format, *args, **kwargs):
|
def __init__(self, message_format, *args, **kwargs):
|
||||||
# TODO: handle translations
|
# TODO: handle translations
|
||||||
super(QubesException, self).__init__(message_format % args, **kwargs)
|
super(QubesException, self).__init__(
|
||||||
|
message_format % tuple(int(d) if d.isdigit() else d for d in args),
|
||||||
|
**kwargs)
|
||||||
|
@ -39,7 +39,6 @@ class TC_00_Errors(qubesmgmt.tests.QubesTestCase):
|
|||||||
self.assertEqual(str(context.exception),
|
self.assertEqual(str(context.exception),
|
||||||
'An error occurred: string, other')
|
'An error occurred: string, other')
|
||||||
|
|
||||||
@unittest.expectedFailure
|
|
||||||
def test_002_exception_with_numbers(self):
|
def test_002_exception_with_numbers(self):
|
||||||
self.app.expected_calls[('dom0', 'mgmt.vm.List', None, None)] = \
|
self.app.expected_calls[('dom0', 'mgmt.vm.List', None, None)] = \
|
||||||
b'2\x00QubesException\x00\x00' \
|
b'2\x00QubesException\x00\x00' \
|
||||||
@ -49,7 +48,7 @@ class TC_00_Errors(qubesmgmt.tests.QubesTestCase):
|
|||||||
vms = list(self.app.domains)
|
vms = list(self.app.domains)
|
||||||
except TypeError as e:
|
except TypeError as e:
|
||||||
self.fail('TypeError: {!s}'.format(e))
|
self.fail('TypeError: {!s}'.format(e))
|
||||||
self.assertEqual(str(context.exception), 'An error occurred: 1 2')
|
self.assertEqual(str(context.exception), 'An error occurred: 1, 2')
|
||||||
|
|
||||||
def test_010_empty(self):
|
def test_010_empty(self):
|
||||||
self.app.expected_calls[('dom0', 'mgmt.vm.List', None, None)] = b''\
|
self.app.expected_calls[('dom0', 'mgmt.vm.List', None, None)] = b''\
|
||||||
|
Loading…
Reference in New Issue
Block a user