def test_publish_should_actually_write_content():
    draftin_a_flask.subprocess = MagicMock()
    draftin_a_flask.CONTENT = 'fnord'
    expected_content = "This is some sweet *content*"
    name = "fnordy fnord"
    fname = os.path.join(draftin_a_flask.ROOT,
                         draftin_a_flask.CONTENT,
                         name.replace(' ', '-') + '.md')

    draftin_a_flask.publish(name, expected_content)

    with open(fname) as f:
        actual_content = f.read()
        assert actual_content == expected_content

    shutil.rmtree(os.path.join(draftin_a_flask.ROOT, draftin_a_flask.CONTENT))
dataset/ETHPy150Open waynew/draftin-a-flask/tests/test_draftin_a_flask.py/test_publish_should_actually_write_content/original