Skip to content

Commit 56c2399

Browse files
author
anon
committed
minor fixes
1 parent a132ad6 commit 56c2399

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

qubesadmin/device_protocol.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,26 +29,27 @@
2929
should be moved to one place.
3030
"""
3131

32+
from __future__ import annotations
3233

3334
import string
3435
import sys
36+
import typing
3537
from enum import Enum
3638
from typing import Optional, Any
3739
from collections.abc import Callable
3840

3941
import qubesadmin.exc
4042
from qubesadmin.exc import QubesValueError
4143

44+
if typing.TYPE_CHECKING:
45+
from qubesadmin.vm import QubesVM
46+
4247

4348
class ProtocolError(AssertionError):
4449
"""
4550
Raised when something is wrong with data received.
4651
"""
4752

48-
49-
QubesVM = 'qubesadmin.vm.QubesVM'
50-
51-
5253
class UnexpectedDeviceProperty(qubesadmin.exc.QubesException, ValueError):
5354
"""
5455
Device has unexpected property such as backend_domain, devclass etc.

qubesadmin/tests/tools/qvm_template.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5474,7 +5474,7 @@ def test_240_qubes_release(self, mock_exists):
54745474
self.assertEqual(mock_exists.mock_calls, [
54755475
mock.call('/usr/share/qubes/marker-vm')
54765476
])
5477-
mock_open.assert_called_with('/etc/os-release', 'r',
5477+
mock_open.assert_called_with('/etc/os-release',
54785478
encoding='ascii')
54795479
self.assertAllCalled()
54805480

@@ -5499,7 +5499,7 @@ def test_241_qubes_release_quotes(self, mock_exists):
54995499
self.assertEqual(mock_exists.mock_calls, [
55005500
mock.call('/usr/share/qubes/marker-vm')
55015501
])
5502-
mock_open.assert_called_with('/etc/os-release', 'r',
5502+
mock_open.assert_called_with('/etc/os-release',
55035503
encoding='ascii')
55045504
self.assertAllCalled()
55055505

@@ -5519,7 +5519,7 @@ def test_242_qubes_release_quotes(self, mock_exists):
55195519
self.assertEqual(mock_exists.mock_calls, [
55205520
mock.call('/usr/share/qubes/marker-vm')
55215521
])
5522-
mock_open.assert_called_with('/usr/share/qubes/marker-vm', 'r',
5522+
mock_open.assert_called_with('/usr/share/qubes/marker-vm',
55235523
encoding='ascii')
55245524
self.assertAllCalled()
55255525

0 commit comments

Comments
 (0)