示例#1
0
def test_makefile_has_docker_tag_false():
    fake_makefile_path = 'UNUSED'
    fake_contents = 'target:\n    command'
    with patch('paasta_tools.cli.cmds.check.get_file_contents',
               autospec=True,
               return_value=fake_contents):
        assert makefile_has_docker_tag(fake_makefile_path) is False
示例#2
0
def test_makefile_has_docker_tag_true():
    fake_makefile_path = 'UNUSED'
    fake_contents = 'Blah\nDOCKER_TAG ?= something:\ntarget:\n    command'
    with patch('paasta_tools.cli.cmds.check.get_file_contents',
               autospec=True,
               return_value=fake_contents):
        assert makefile_has_docker_tag(fake_makefile_path) is True
示例#3
0
def test_makefile_has_docker_tag_false():
    fake_makefile_path = "UNUSED"
    fake_contents = "target:\n    command"
    with patch(
            "paasta_tools.cli.cmds.check.get_file_contents",
            autospec=True,
            return_value=fake_contents,
    ):
        assert makefile_has_docker_tag(fake_makefile_path) is False
示例#4
0
def test_makefile_has_docker_tag_false():
    fake_makefile_path = 'UNUSED'
    fake_contents = 'target:\n    command'
    with contextlib.nested(
        patch(
            'paasta_tools.cli.cmds.check.get_file_contents',
            autospec=True,
            return_value=fake_contents
        ),
    ) as (
        mock_get_file_contents,
    ):
        assert makefile_has_docker_tag(fake_makefile_path) is False