def test_file_exists(self):
     """Function to test file_exists method"""
     import os
     GuardrailGlobals.generate_pylint_cmd = self.generate_pylint_cmd
     with patch('sys.exit') as exit_mock:
         Guardails.file_exists(os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)))
         assert not exit_mock.called
Beispiel #2
0
 def get_guardrails_obj():
     """Function to create guardrails class object"""
     import os
     ini_path = os.path.abspath(
         os.path.join(os.path.dirname(__file__), os.pardir))
     ini_path = os.path.join(ini_path, "test_resource", "guardrail.ini")
     return Guardails(ini_path)
Beispiel #3
0
 def test_file_exists_exit(self):  # pylint: disable=R0201
     """Function to test file_exists_exit method"""
     with patch('sys.exit') as exit_mock:
         Guardails.file_exists("abc")
         assert exit_mock.called
"""Koninklijke Philips N.V., 2019 - 2020. All rights reserved."""

import sys
from guardrails.guardrails import Guardails
from guardrails.guardrails import create_parser

if __name__ == '__main__':
    ARGS = create_parser(sys.argv[1:])
    GUARD_OBJ = Guardails(ARGS.path)
    GUARD_OBJ.orchestrate_guardrails()