Example #1
0
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
Example #2
0
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
Example #3
0
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"
Example #4
0
def test_num_line(dockerfile_path, size):
    parser = DockerfileParser()
    dockerfile = parser.from_file(dockerfile_path)
    assert len(dockerfile) == size
Example #5
0
def test_num_lines_str(dockerfile, size):
    parser = DockerfileParser()
    parsed_dockerfile = parser.from_string(dockerfile)
    assert len(parsed_dockerfile) == size
Example #6
0
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"
Example #7
0
def test_num_line(dockerfile_path, size):
    parser = DockerfileParser()
    dockerfile = parser.from_file(dockerfile_path)
    assert len(dockerfile) == size
Example #8
0
def test_num_lines_str(dockerfile, size):
    parser = DockerfileParser()
    parsed_dockerfile = parser.from_string(dockerfile)
    assert len(parsed_dockerfile) == size
Example #9
0
def dockerfile_with_comments():
    parser = DockerfileParser()
    return parser.from_string(dockerfile_with_comments_str())
Example #10
0
def basic_dockerfile():
    parser = DockerfileParser()
    return parser.from_string(dockerfile_str())
Example #11
0
def dockerfile_with_comments():
    parser = DockerfileParser()
    return parser.from_string(dockerfile_with_comments_str())
Example #12
0
def basic_dockerfile():
    parser = DockerfileParser()
    return parser.from_string(dockerfile_str())