Пример #1
0
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
Пример #2
0
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)
Пример #3
0
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)
Пример #4
0
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
Пример #5
0
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
Пример #6
0
def assert_file_exist(test_file_name):

    file_path = PROVISION_ROOT_PATH.format(test_file_name)
    return files.exists(file_path)