コード例 #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
コード例 #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
コード例 #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"
コード例 #4
0
def test_num_line(dockerfile_path, size):
    parser = DockerfileParser()
    dockerfile = parser.from_file(dockerfile_path)
    assert len(dockerfile) == size
コード例 #5
0
def test_num_lines_str(dockerfile, size):
    parser = DockerfileParser()
    parsed_dockerfile = parser.from_string(dockerfile)
    assert len(parsed_dockerfile) == size
コード例 #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"
コード例 #7
0
def test_num_line(dockerfile_path, size):
    parser = DockerfileParser()
    dockerfile = parser.from_file(dockerfile_path)
    assert len(dockerfile) == size
コード例 #8
0
def test_num_lines_str(dockerfile, size):
    parser = DockerfileParser()
    parsed_dockerfile = parser.from_string(dockerfile)
    assert len(parsed_dockerfile) == size
コード例 #9
0
ファイル: fixtures.py プロジェクト: pombredanne/pydockerfile
def dockerfile_with_comments():
    parser = DockerfileParser()
    return parser.from_string(dockerfile_with_comments_str())
コード例 #10
0
ファイル: fixtures.py プロジェクト: pombredanne/pydockerfile
def basic_dockerfile():
    parser = DockerfileParser()
    return parser.from_string(dockerfile_str())
コード例 #11
0
ファイル: fixtures.py プロジェクト: eriknelson/pydockerfile
def dockerfile_with_comments():
    parser = DockerfileParser()
    return parser.from_string(dockerfile_with_comments_str())
コード例 #12
0
ファイル: fixtures.py プロジェクト: eriknelson/pydockerfile
def basic_dockerfile():
    parser = DockerfileParser()
    return parser.from_string(dockerfile_str())