def test_eq(dockerfile_s, dockerfile_path, dockerfile_ne_path):
    parser = DockerfileParser()
    dockerfile_str = parser.from_string(dockerfile_s)
    dockerfile_file = parser.from_file(dockerfile_path)
    dockerfile_ne = parser.from_file(dockerfile_ne_path)
    assert dockerfile_str == dockerfile_file
    assert dockerfile_str != dockerfile_ne
    assert dockerfile_file != dockerfile_ne
    assert dockerfile_ne == dockerfile_ne
def test_eq(dockerfile_s, dockerfile_path, dockerfile_ne_path):
    parser = DockerfileParser()
    dockerfile_str = parser.from_string(dockerfile_s)
    dockerfile_file = parser.from_file(dockerfile_path)
    dockerfile_ne = parser.from_file(dockerfile_ne_path)
    assert dockerfile_str == dockerfile_file
    assert dockerfile_str != dockerfile_ne
    assert dockerfile_file != dockerfile_ne
    assert dockerfile_ne == dockerfile_ne
def test_comments(dockerfile_with_comments_str):
    parser = DockerfileParser()
    dockerfile = parser.from_string(dockerfile_with_comments_str)
    assert dockerfile.lines[0].cmd == "#"
    assert dockerfile.lines[0].args == "Comments before FROM"
def test_num_line(dockerfile_path, size):
    parser = DockerfileParser()
    dockerfile = parser.from_file(dockerfile_path)
    assert len(dockerfile) == size
def test_num_lines_str(dockerfile, size):
    parser = DockerfileParser()
    parsed_dockerfile = parser.from_string(dockerfile)
    assert len(parsed_dockerfile) == size
def test_comments(dockerfile_with_comments_str):
    parser = DockerfileParser()
    dockerfile = parser.from_string(dockerfile_with_comments_str)
    assert dockerfile.lines[0].cmd == "#"
    assert dockerfile.lines[0].args == "Comments before FROM"
def test_num_line(dockerfile_path, size):
    parser = DockerfileParser()
    dockerfile = parser.from_file(dockerfile_path)
    assert len(dockerfile) == size
def test_num_lines_str(dockerfile, size):
    parser = DockerfileParser()
    parsed_dockerfile = parser.from_string(dockerfile)
    assert len(parsed_dockerfile) == size
Exemple #9
0
def dockerfile_with_comments():
    parser = DockerfileParser()
    return parser.from_string(dockerfile_with_comments_str())
Exemple #10
0
def basic_dockerfile():
    parser = DockerfileParser()
    return parser.from_string(dockerfile_str())
Exemple #11
0
def dockerfile_with_comments():
    parser = DockerfileParser()
    return parser.from_string(dockerfile_with_comments_str())
Exemple #12
0
def basic_dockerfile():
    parser = DockerfileParser()
    return parser.from_string(dockerfile_str())