format: Upgrade to black-21.6b0

Signed-off-by: Gris Ge <fge@redhat.com>
This commit is contained in:
Gris Ge 2021-06-18 14:41:03 +08:00 committed by Fernando Fernández Mancera
parent e3d880c326
commit 97d4b3efd7
5 changed files with 11 additions and 11 deletions

View File

@ -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)

View File

@ -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:

View File

@ -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)

View File

@ -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)

View File

@ -27,7 +27,7 @@ skip_install = true
basepython = python3.6
changedir = {toxinidir}
deps =
black==20.8b1
black==21.6b0
# style configured via pyproject.toml
commands =
black \