def test_salt_cp_no_match(master, minion, salt_cp, tempfiles):
    assert master.is_alive()
    assert minion.is_alive()
    tfile = tempfile.NamedTemporaryFile(delete=True)
    tfile.close()
    dest = tfile.name
    try:
        contents = 'id: foo'
        sls = tempfiles.makeslsfile(contents)
        assert master.is_alive()
        assert minion.is_alive()
        ret = salt_cp.run(sls, dest, minion_tgt='minion-2')
        assert (ret.exitcode == 0), ret
        assert (not ret.json), ret
        assert (not os.path.exists(dest))
    finally:
        if os.path.exists(dest):
            os.unlink(dest)
def test_salt_cp_no_match(master, minion, salt_cp, tempfiles):
    assert master.is_alive()
    assert minion.is_alive()
    tfile = tempfile.NamedTemporaryFile(delete=True)
    tfile.close()
    dest = tfile.name
    try:
        contents = 'id: foo'
        sls = tempfiles.makeslsfile(contents)
        assert master.is_alive()
        assert minion.is_alive()
        ret = salt_cp.run(sls, dest, minion_tgt='minion-2')
        assert (ret.exitcode == 0), ret
        assert (not ret.json), ret
        assert (not os.path.exists(dest))
    finally:
        if os.path.exists(dest):
            os.unlink(dest)