当前位置: 首页>>代码示例>>Python>>正文


Python ansiblelint.Runner类代码示例

本文整理汇总了Python中ansiblelint.Runner的典型用法代码示例。如果您正苦于以下问题:Python Runner类的具体用法?Python Runner怎么用?Python Runner使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Runner类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_runner_encrypted_secrets

 def test_runner_encrypted_secrets(self):
     from pkg_resources import parse_version
     import ansible
     # Only run this test for ansible 2.3+
     # It checks ansible-lint's parsing of yaml files that contain
     # encrypted secrets.
     if parse_version(ansible.__version__) >= parse_version('2.3'):
         filename = 'test/contains_secrets.yml'
         runner = Runner(self.rules, filename, [], [], [])
         assert (len(runner.run()) == 0)
开发者ID:willthames,项目名称:ansible-lint,代码行数:10,代码来源:TestRunner.py

示例2: test_files_not_scanned_twice

    def test_files_not_scanned_twice(self):
        checked_files = set()

        filename = os.path.abspath('test/common-include-1.yml')
        runner = Runner(self.rules, filename, [], [], [], 0, checked_files)
        run1 = runner.run()

        filename = os.path.abspath('test/common-include-2.yml')
        runner = Runner(self.rules, filename, [], [], [], 0, checked_files)
        run2 = runner.run()

        assert ((len(run1) + len(run2)) == 1)
开发者ID:willthames,项目名称:ansible-lint,代码行数:12,代码来源:TestRunner.py

示例3: test_import_role_inline_args

 def test_import_role_inline_args(self):
     fh = self._get_play_file(PLAY_IMPORT_ROLE_INLINE)
     runner = Runner(self.rules, fh.name, [], [], [])
     results = runner.run()
     assert 'only when shell functionality is required' in str(results)
开发者ID:willthames,项目名称:ansible-lint,代码行数:5,代码来源:TestImportIncludeRole.py

示例4: test_file_negative

 def test_file_negative(self):
     failure = 'test/become-user-without-become-failure.yml'
     bad_runner = Runner(self.collection, failure, [], [], [])
     errs = bad_runner.run()
     self.assertEqual(3, len(errs))
开发者ID:ansiblers,项目名称:ansible-lint,代码行数:5,代码来源:TestBecomeUserWithoutBecome.py

示例5: test_file_negative

 def test_file_negative(self):
     failure = 'test/octalpermissions-failure.yml'
     bad_runner = Runner(self.collection, failure, [], [], [])
     errs = bad_runner.run()
     self.assertEqual(4, len(errs))
开发者ID:ansiblers,项目名称:ansible-lint,代码行数:5,代码来源:TestOctalPermissions.py

示例6: test_positive_skip_tag

 def test_positive_skip_tag(self):
     skip_tag = 'ANSIBLE0002'
     good_runner = Runner(self.collection, self.file, [], [skip_tag], [])
     self.assertEqual([], good_runner.run())
开发者ID:willthames,项目名称:ansible-lint,代码行数:4,代码来源:TestWithSkipTagId.py

示例7: test_negative_with_tag

 def test_negative_with_tag(self):
     with_tag = 'ANSIBLE0002'
     bad_runner = Runner(self.collection, self.file, [with_tag], [], [])
     errs = bad_runner.run()
     self.assertGreater(len(errs), 0)
开发者ID:willthames,项目名称:ansible-lint,代码行数:5,代码来源:TestWithSkipTagId.py

示例8: test_negative_no_param

 def test_negative_no_param(self):
     bad_runner = Runner(self.collection, self.file, [], [], [])
     errs = bad_runner.run()
     self.assertGreater(len(errs), 0)
开发者ID:willthames,项目名称:ansible-lint,代码行数:4,代码来源:TestWithSkipTagId.py

示例9: test_file_negative

 def test_file_negative(self):
     failure = 'test/use-handler-rather-than-when-changed-failure.yml'
     bad_runner = Runner(self.collection, failure, [], [], [])
     errs = bad_runner.run()
     self.assertEqual(5, len(errs))
开发者ID:ansiblers,项目名称:ansible-lint,代码行数:5,代码来源:TestUseHandlerRatherThanWhenChanged.py

示例10: test_file_positive

 def test_file_positive(self):
     success = 'test/use-handler-rather-than-when-changed-success.yml'
     good_runner = Runner(self.collection, success, [], [], [])
     self.assertEqual([], good_runner.run())
开发者ID:ansiblers,项目名称:ansible-lint,代码行数:4,代码来源:TestUseHandlerRatherThanWhenChanged.py

示例11: test_gitlab_dependency_is_ok

 def test_gitlab_dependency_is_ok(self):
     filename = 'test/dependency-in-meta/gitlab.yml'
     good_runner = Runner(self.rules, filename, [], [], [])
     self.assertEqual([], good_runner.run())
开发者ID:willthames,项目名称:ansible-lint,代码行数:4,代码来源:TestDependenciesInMeta.py

示例12: test_runner_empty_tags_count

 def test_runner_empty_tags_count(self):
     filename = 'test/emptytags.yml'
     runner = Runner(self.rules, filename, [], [], [])
     assert (len(runner.run()) == 0)
开发者ID:ansiblers,项目名称:ansible-lint,代码行数:4,代码来源:TestRunner.py

示例13: test_runner_become_count

 def test_runner_become_count(self):
     filename = 'test/become.yml'
     runner = Runner(self.rules, filename, [], [], [])
     assert (len(runner.run()) == 0)
开发者ID:ansiblers,项目名称:ansible-lint,代码行数:4,代码来源:TestRunner.py

示例14: test_runner_excludes_paths

 def test_runner_excludes_paths(self):
     filename = 'examples/lots_of_warnings.yml'
     excludes = ['examples/lots_of_warnings.yml']
     runner = Runner(self.rules, filename, [], [], excludes)
     assert (len(runner.run()) == 0)
开发者ID:ansiblers,项目名称:ansible-lint,代码行数:5,代码来源:TestRunner.py

示例15: test_file_negative

 def test_file_negative(self):
     failure = 'test/env-vars-in-command-failure.yml'
     bad_runner = Runner(self.collection, failure, [], [], [])
     errs = bad_runner.run()
     self.assertEqual(2, len(errs))
开发者ID:ansiblers,项目名称:ansible-lint,代码行数:5,代码来源:TestEnvVarsInCommand.py


注:本文中的ansiblelint.Runner类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。