################################ cmake_test/asserts/file_contains ################################ .. module:: cmake_test/asserts/file_contains .. function:: ct_assert_file_contains(file text) Assert a file contains the specified text. Asserts that the file at the specified path contains the specified text. If the file does not exist or does not contain the specified contents, an :code:`ASSERTION_FAILED` exception is raised. :param file: The file to check :type file: path :param text: The text to check for :type text: str .. function:: ct_assert_file_does_not_contain(file text) Assert a file does not contain the specified text. Asserts that the file at the specified path does not contain the specified text. If the path does not exist or the file at that path does contain the text, an :code:`ASSERTION_FAILED` exception will be raised. :param file: The file to check :type file: path :param text: The text to check for :type text: str .. function:: ct_file_contains(result file text) Determines if a file contains some text. This function checks whether a file contains some text and returns a boolean result. Will raise an :code:`ASSERTION_FAILED` exception if the file does not exist. :param result: Name to use for the variable which will hold the result. :type result: bool* :param file: The file to check. :type file: path :param text: The text to check for. :type text: str :returns: ``result`` will be set to ``TRUE`` if file contains the text and ``FALSE`` if it does not. :rtype: bool