Permalink
Browse files

Blacken under black 18.6b4

  • Loading branch information...
bitprophet committed Jun 26, 2018
1 parent 8e562ac commit 87bba0734f243241190a113a26e877ef490c45e5
@@ -33,6 +33,7 @@ class Config(InvokeConfig):
.. versionadded:: 2.0
"""
prefix = "fabric"
def __init__(self, *args, **kwargs):
@@ -92,6 +92,7 @@ class Connection(Context):
.. versionadded:: 2.0
"""
# NOTE: these are initialized here to hint to invoke.Config.__setattr__
# that they should be treated as real attributes instead of config proxies.
# (Additionally, we're doing this instead of using invoke.Config._set() so
@@ -245,9 +246,7 @@ def __init__(
shorthand = self.derive_shorthand(host)
host = shorthand["host"]
err = (
"You supplied the {} via both shorthand and kwarg! Please pick one." # noqa
)
err = "You supplied the {} via both shorthand and kwarg! Please pick one." # noqa
if shorthand["user"] is not None:
if user is not None:
raise ValueError(err.format("user"))
@@ -465,19 +464,13 @@ def open(self):
# Short-circuit
if self.is_connected:
return
err = (
"Refusing to be ambiguous: connect() kwarg '{}' was given both via regular arg and via connect_kwargs!" # noqa
)
err = "Refusing to be ambiguous: connect() kwarg '{}' was given both via regular arg and via connect_kwargs!" # noqa
# These may not be given, period
for (
key
) in (
"""
for key in """
hostname
port
username
""".split()
):
""".split():
if key in self.connect_kwargs:
raise ValueError(err.format(key))
# These may be given one way or the other, but not both
@@ -7,7 +7,6 @@
# TODO: come up w/ a better name heh
class FabExecutor(Executor):
def expand_calls(self, calls, apply_hosts=True):
# Generate new call list with per-host variants & Connections inserted
ret = []
@@ -16,7 +16,6 @@
class Fab(Program):
def print_version(self):
super(Fab, self).print_version()
print("Paramiko {}".format(paramiko))
@@ -22,6 +22,7 @@ class Transfer(object):
.. versionadded:: 2.0
"""
# TODO: SFTP clear default, but how to do SCP? subclass? init kwarg?
def __init__(self, connection):
@@ -255,6 +256,7 @@ class Result(object):
.. versionadded:: 2.0
"""
# TODO: how does this differ from put vs get? field stating which? (feels
# meh) distinct classes differing, for now, solely by name? (also meh)
def __init__(self, local, orig_local, remote, orig_remote, connection):
@@ -13,9 +13,7 @@ def skip_outside_travis():
class Connection_:
class ssh_connections:
def open_method_generates_real_connection(self):
c = Connection("localhost")
c.open()
@@ -32,7 +30,6 @@ def close_method_closes_connection(self):
assert c.is_connected is False
class run:
def simple_command_on_host(self):
"""
Run command on localhost
@@ -59,7 +56,6 @@ def simple_command_with_pty(self):
assert result.pty is True
class local:
def wraps_invoke_run(self):
# NOTE: most of the interesting tests about this are in
# invoke.runners / invoke.integration.
@@ -81,7 +77,6 @@ def mixed_use_of_local_and_run(self):
assert result.stdout == "foo\n"
class sudo:
def setup(self):
# NOTE: assumes a user configured for passworded (NOT
# passwordless)_sudo, whose password is 'mypass', is executing the
@@ -5,7 +5,6 @@
class Group_:
def simple_command(self):
group = Group("localhost", "127.0.0.1")
result = group.run("echo foo", hide=True)
@@ -12,9 +12,7 @@ def _support(*parts):
class Transfer_:
class get:
def setup(self):
self.c = Connection("localhost")
self.remote = _support("file.txt")
@@ -52,7 +50,6 @@ def mode_preservation(self, tmpdir):
assert stat.S_IMODE(local.stat().mode) == 0o641
class put:
def setup(self):
self.c = Connection("localhost")
self.remote = path.local.mkdtemp().join("file.txt").realpath()
@@ -388,7 +388,6 @@ def stop(self):
# adding a ton of fixtures everywhere (and thus, opening up to forgetting it
# for new tests...)
class Config(Config_):
def __init__(self, *args, **kwargs):
wat = "You're giving ssh_config explicitly, please use Config_!"
assert "ssh_config" not in kwargs, wat
@@ -398,7 +397,6 @@ def __init__(self, *args, **kwargs):
class Connection(Connection_):
def __init__(self, *args, **kwargs):
# Make sure we're using our tweaked Config if none was given.
kwargs.setdefault("config", Config())
@@ -12,7 +12,6 @@
class Config_:
def defaults_to_merger_of_global_defaults(self):
# I.e. our global_defaults + Invoke's global_defaults
c = Config()
@@ -163,7 +162,6 @@ def user_path_subject_to_user_expansion(self, method):
method.assert_any_call(expanduser(tilded))
class core_ssh_load_option_allows_skipping_ssh_config_loading:
@patch.object(Config, "_load_ssh_file")
def skips_default_paths(self, method):
Config(overrides={"load_ssh_configs": False})
@@ -189,7 +187,6 @@ def does_not_skip_loading_runtime_path(self, method):
method.assert_called_once_with(self._runtime_path)
class lazy_loading_and_explicit_methods:
@patch.object(Config, "_load_ssh_file")
def may_use_lazy_plus_explicit_methods_to_control_flow(self, method):
c = Config(lazy=True)
Oops, something went wrong.

0 comments on commit 87bba07

Please sign in to comment.