def assert_content_in_file(file_name, expected_content): file_path = PROVISION_ROOT_PATH.format(file_name) fd = StringIO() get(file_path, fd) file_content = fd.getvalue() return expected_content in file_content
def assert_file_exist(test_file_name): """ Fabric assertion: Check if file (result of installing a test product) exists on the current remote hosts. :param test_file_name: File name :return: True if given file exists on the current remote host (dir: PROVISION_ROOT_PATH). """ file_path = PROVISION_ROOT_PATH.format(test_file_name) return files.exists(file_path)
def assert_content_in_file(file_name, expected_content): """ Fabric assertion: Check if some text is in the specified file (result of installing a test product) Provision dir: PROVISION_ROOT_PATH :param file_name: File name :param expected_content: String to be found in file :return: True if given content is in file (dir: PROVISION_ROOT_PATH). """ file_path = PROVISION_ROOT_PATH.format(file_name) fd = StringIO() get(file_path, fd) file_content = fd.getvalue() return expected_content in file_content
def assert_file_exist(test_file_name): file_path = PROVISION_ROOT_PATH.format(test_file_name) return files.exists(file_path)