Exemplo n.º 1
0
def test_create_existent():
    w = Wiki(setups.BARE_REPO_PATH)
    try:
        w.create_page('test/test', 'mdown', setups.EXAMPLE_AUTHOR)
    except PageExists:
        pass
    else:
        assert False
Exemplo n.º 2
0
def test_merge_into_tree_with_modifications_to_different_files():
    w = Wiki(setups.BARE_REPO_PATH)
    w.create_page('test1', 'md', setups.EXAMPLE_AUTHOR)
    w.create_page('test2', 'md', setups.EXAMPLE_AUTHOR)
    p1 = w.get_page('test1')
    p2 = w.get_page('test2')
    p1.content = 'test1\n'
    p1.save(setups.EXAMPLE_AUTHOR)
    # the branch has now moved since p2 was pulled out of the repo
    p2.content = 'test2\n'
    p2.save(setups.EXAMPLE_AUTHOR) # this SHOULD commit our changes, then merge
                                   # in p1's changes
    p1 = w.get_page('test1') # re-pull from the current head
    print p1.content
    assert p1.content == 'test1\n'
Exemplo n.º 3
0
def test_create_new_subdir():
    w = Wiki(setups.BARE_REPO_PATH)
    w.create_page('test2/test2', 'mdown', setups.EXAMPLE_AUTHOR)
    p = w.get_page('test2/test2')
    assert p.content == '\n'
    assert p.fmt == 'mdown'
Exemplo n.º 4
0
def test_unicode_titles():
    w = Wiki(setups.BARE_REPO_PATH)
    w.create_page('いろはにほへとち/test', 'mdown', setups.EXAMPLE_AUTHOR)
    p = w.get_page('いろはにほへとち/test')