format: Upgrade to black-21.6b0
Signed-off-by: Gris Ge <fge@redhat.com>
This commit is contained in:
parent
e3d880c326
commit
97d4b3efd7
@ -29,14 +29,14 @@ from libnmstate.error import NmstateValueError
|
||||
|
||||
|
||||
def test_creating_one_checkpoint(nm_context):
|
||||
""" I can create a checkpoint """
|
||||
"""I can create a checkpoint"""
|
||||
checkpoint = CheckPoint.create(nm_context)
|
||||
assert checkpoint is not None
|
||||
checkpoint.destroy()
|
||||
|
||||
|
||||
def test_creating_two_checkpoints(nm_context):
|
||||
""" I cannot create a checkpoint when a checkpoint already exists. """
|
||||
"""I cannot create a checkpoint when a checkpoint already exists."""
|
||||
checkpoint = CheckPoint.create(nm_context)
|
||||
with pytest.raises(NmstateConflictError):
|
||||
CheckPoint.create(nm_context)
|
||||
@ -45,7 +45,7 @@ def test_creating_two_checkpoints(nm_context):
|
||||
|
||||
|
||||
def test_checkpoint_timeout(nm_context):
|
||||
""" I can create a checkpoint that is removed after one second. """
|
||||
"""I can create a checkpoint that is removed after one second."""
|
||||
checkpoint_a = CheckPoint.create(nm_context, timeout=1)
|
||||
time.sleep(1)
|
||||
checkpoint_b = CheckPoint.create(nm_context)
|
||||
@ -56,7 +56,7 @@ def test_checkpoint_timeout(nm_context):
|
||||
|
||||
|
||||
def test_getting_a_checkpoint(nm_context):
|
||||
""" I can get a list of all checkpoints. """
|
||||
"""I can get a list of all checkpoints."""
|
||||
|
||||
checkpoints = get_checkpoints(nm_context.client)
|
||||
|
||||
|
@ -195,7 +195,7 @@ def test_apply_command_with_two_states():
|
||||
|
||||
|
||||
def test_manual_confirmation(eth1_up):
|
||||
""" I can manually confirm a state. """
|
||||
"""I can manually confirm a state."""
|
||||
|
||||
with example_state(CONFIRMATION_CLEAN, CONFIRMATION_CLEAN):
|
||||
|
||||
@ -206,7 +206,7 @@ def test_manual_confirmation(eth1_up):
|
||||
|
||||
|
||||
def test_manual_rollback(eth1_up):
|
||||
""" I can manually roll back a state. """
|
||||
"""I can manually roll back a state."""
|
||||
|
||||
with example_state(CONFIRMATION_CLEAN, CONFIRMATION_CLEAN) as clean_state:
|
||||
|
||||
@ -236,7 +236,7 @@ def test_dual_change(eth1_up):
|
||||
|
||||
|
||||
def test_automatic_rollback(eth1_up):
|
||||
""" If I do not confirm the state, it is automatically rolled back. """
|
||||
"""If I do not confirm the state, it is automatically rolled back."""
|
||||
|
||||
with example_state(CONFIRMATION_CLEAN, CONFIRMATION_CLEAN) as clean_state:
|
||||
|
||||
|
@ -43,7 +43,7 @@ def assert_state(desired_state_data):
|
||||
|
||||
|
||||
def assert_absent(*ifnames):
|
||||
""" Assert that a interface is not present in the current state """
|
||||
"""Assert that a interface is not present in the current state"""
|
||||
|
||||
current_state = statelib.show_only(ifnames)
|
||||
assert not current_state[Interface.KEY]
|
||||
@ -61,7 +61,7 @@ def assert_state_match(desired_state_data):
|
||||
|
||||
|
||||
def assert_mac_address(state, expected_mac=None):
|
||||
""" Asserts that all MAC addresses of ifaces in a state are the same """
|
||||
"""Asserts that all MAC addresses of ifaces in a state are the same"""
|
||||
macs = _iface_macs(state)
|
||||
if not expected_mac:
|
||||
expected_mac = next(macs)
|
||||
|
@ -26,7 +26,7 @@ from . import statelib
|
||||
|
||||
|
||||
def ifaces_init(*ifnames):
|
||||
""" Remove any existing definitions on the interfaces. """
|
||||
"""Remove any existing definitions on the interfaces."""
|
||||
for ifname in ifnames:
|
||||
_set_eth_admin_state(ifname, schema.InterfaceState.ABSENT)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user