openstack-ansible-tests/ansible-lint/test/TestNoLogPasswordsRule.py
Jonathan Rosser cef65a6390 Update ansible-lint==4.3.5, flake8==3.8.3, bashate>=0.5.1
Correct lint errors that arise from these version updates.

Change-Id: I3216032b0d383ca6d4f6304c92151ce12dc5e114
2020-09-30 11:24:29 +00:00

24 lines
770 B
Python

import unittest
from ansiblelint.rules import RulesCollection
from ansiblelint.runner import Runner
from NoLogPasswordsRule import NoLogPasswordsRule
class TestNoLogPasswordsRule(unittest.TestCase):
collection = RulesCollection()
def setUp(self):
self.collection.register(NoLogPasswordsRule())
def test_file_positive(self):
success = 'ansible-lint/test/no-log-passwords-success.yml'
good_runner = Runner(self.collection, success, [], [], [])
self.assertEqual([], good_runner.run())
def test_file_negative(self):
failure = 'ansible-lint/test/no-log-passwords-failure.yml'
bad_runner = Runner(self.collection, failure, [], [], [])
errs = bad_runner.run()
self.assertEqual(3, len(errs))