예제 #1
0
def test_docmd_create_keyfile_if_exists():
    with wrap() as wrapper:
        with open(".dexyapis", "w") as f:
            f.write("{}")
        assert os.path.exists(".dexyapis")
        try:
            WordPressFilter.docmd_create_keyfile()
            assert False, ' should raise exception'
        except dexy.exceptions.UserFeedback as e:
            assert ".dexyapis already exists" in e.message
예제 #2
0
def test_docmd_create_keyfile():
    with wrap() as wrapper:
        assert not os.path.exists(".dexyapis")
        WordPressFilter.docmd_create_keyfile()
        assert os.path.exists(".dexyapis")