def test_compose_project_name_incorporates_environment(tmpdir): playbook_path = tmpdir.join('test_playbook.yml') playbook_path.ensure() ctx = GoodplayContext(playbook_path) assert ctx.compose_project_name('env1') != ctx.compose_project_name('env2')
def test_compose_project_name_is_same_for_playbook_path_and_environment(tmpdir): playbook_path = tmpdir.join('test_playbook.yml') playbook_path.ensure() ctx = GoodplayContext(playbook_path) assert ctx.compose_project_name('env1') == ctx.compose_project_name('env1')
def test_compose_project_name_is_same_for_playbook_path_and_environment( tmpdir): playbook_path = tmpdir.join('test_playbook.yml') playbook_path.ensure() ctx = GoodplayContext(playbook_path) assert ctx.compose_project_name('env1') == ctx.compose_project_name('env1')
def test_compose_project_name_incorporates_playbook_path(tmpdir): playbook_path1 = tmpdir.join('dir1', 'test_playbook.yml') playbook_path1.ensure() playbook_path2 = tmpdir.join('dir2', 'test_playbook.yml') playbook_path2.ensure() ctx1 = GoodplayContext(playbook_path1) ctx2 = GoodplayContext(playbook_path2) assert ctx1.compose_project_name('env1') != ctx2.compose_project_name('env1')
def test_compose_project_name_incorporates_playbook_path(tmpdir): playbook_path1 = tmpdir.join('dir1', 'test_playbook.yml') playbook_path1.ensure() playbook_path2 = tmpdir.join('dir2', 'test_playbook.yml') playbook_path2.ensure() ctx1 = GoodplayContext(playbook_path1) ctx2 = GoodplayContext(playbook_path2) assert ctx1.compose_project_name('env1') != ctx2.compose_project_name( 'env1')
def test_compose_project_name_incorporates_node_id(tmpdir, monkeypatch): playbook_path = tmpdir.join('test_playbook.yml') playbook_path.ensure() ctx = GoodplayContext(playbook_path) compose_project_name1 = ctx.compose_project_name('env1') monkeypatch.setattr('uuid.getnode', lambda: 1234) compose_project_name2 = ctx.compose_project_name('env1') assert compose_project_name1 != compose_project_name2