コード例 #1
0
 def find_opts_config_loses_to_runtime(self, ctx):
     ctx.blacken = dict(find_opts="-and -not -name foo.py")
     blacken(ctx, find_opts="-or -name '*.js'")
     assert "find . -name '*.py' -or -name '*.js'" in ctx.run_command
コード例 #2
0
 def folders_config_loses_to_runtime(self, ctx):
     # Config + CLI opt -> CLI opt wins
     ctx.blacken = dict(folders=["nowhere"])
     blacken(ctx, folders=["nowhere"])
     assert "nowhere" in ctx.run_command
コード例 #3
0
 def find_opts_configurable(self, ctx):
     ctx.blacken = dict(find_opts="-and -not -name foo.py")
     blacken(ctx)
     assert ("find . -name '*.py' -and -not -name foo.py"
             in ctx.run_command)
コード例 #4
0
 def runs_black(self, ctx, kwargs, command):
     blacken(ctx, **kwargs)
     ctx.run.assert_called_once_with(command, pty=True)
コード例 #5
0
 def folders_configurable(self, ctx):
     # Just config -> works fine
     ctx.blacken = dict(folders=["elsewhere"])
     blacken(ctx)
     assert "elsewhere" in ctx.run_command
コード例 #6
0
ファイル: checks.py プロジェクト: pyinvoke/invocations
 def find_opts_config_loses_to_runtime(self, ctx):
     ctx.blacken = dict(find_opts="-and -not -name foo.py")
     blacken(ctx, find_opts="-or -name '*.js'")
     assert "find . -name '*.py' -or -name '*.js'" in ctx.run_command
コード例 #7
0
ファイル: checks.py プロジェクト: pyinvoke/invocations
 def find_opts_configurable(self, ctx):
     ctx.blacken = dict(find_opts="-and -not -name foo.py")
     blacken(ctx)
     assert (
         "find . -name '*.py' -and -not -name foo.py" in ctx.run_command
     )
コード例 #8
0
ファイル: checks.py プロジェクト: pyinvoke/invocations
 def folders_config_loses_to_runtime(self, ctx):
     # Config + CLI opt -> CLI opt wins
     ctx.blacken = dict(folders=["nowhere"])
     blacken(ctx, folders=["nowhere"])
     assert "nowhere" in ctx.run_command
コード例 #9
0
ファイル: checks.py プロジェクト: pyinvoke/invocations
 def folders_configurable(self, ctx):
     # Just config -> works fine
     ctx.blacken = dict(folders=["elsewhere"])
     blacken(ctx)
     assert "elsewhere" in ctx.run_command
コード例 #10
0
ファイル: checks.py プロジェクト: pyinvoke/invocations
 def runs_black(self, ctx, kwargs, command):
     blacken(ctx, **kwargs)
     ctx.run.assert_called_once_with(command, pty=True)