diff MoinMoin/converter/_tests/test_include.py @ 0:5568cf133caf moin20-repo-reboot

create moin/2.0 repo, drop all history (see notes below) Up to now, we used the moin/2.0-dev repository (which was cloned from another, older moin repo quite some time ago). Over the years, these repositories got rather fat (>200MB) and were a pain to clone over slow, high-latency or unreliable connections. After having finished most of the dirty work in moin2, having killed all the 3rd party code we had bundled with (is now installed by quickinstall / pip / setuptools), it is now a good time to get rid of the history (the history made up most of the repository's size). If you need to look at the history, look there: http://hg.moinmo.in/moin/2.0-dev The new moin/2.0 repository has the files as of this changesets: http://hg.moinmo.in/moin/2.0-dev/rev/075132a755dc The changeset hashes that link the repositories will be tagged (in both repositories) as "moin20-repo-reboot".
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 20 Feb 2011 20:53:45 +0100
parents
children 335d7489a074
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MoinMoin/converter/_tests/test_include.py	Sun Feb 20 20:53:45 2011 +0100
@@ -0,0 +1,49 @@
+"""
+MoinMoin - Tests for MoinMoin.converter.include
+
+@copyright: 2008 MoinMoin:BastianBlank
+@license: GNU GPL, see COPYING for details.
+"""
+
+import py.test
+
+from MoinMoin.converter.include import *
+
+def test_XPointer():
+    x = XPointer('a')
+    assert len(x) == 1
+    e = x[0]
+    assert e.name == 'a'
+    assert e.data is None
+
+    x = XPointer('a(b)')
+    assert len(x) == 1
+    e = x[0]
+    assert e.name == 'a'
+    assert e.data == 'b'
+
+    x = XPointer('a(^(b^)^^)')
+    assert len(x) == 1
+    e = x[0]
+    assert e.name == 'a'
+    assert e.data == '^(b^)^^'
+    assert e.data_unescape == '(b)^'
+
+    x = XPointer('a(b)c(d)')
+    assert len(x) == 2
+    e = x[0]
+    assert e.name == 'a'
+    assert e.data == 'b'
+    e = x[1]
+    assert e.name == 'c'
+    assert e.data == 'd'
+
+    x = XPointer('a(b) c(d)')
+    assert len(x) == 2
+    e = x[0]
+    assert e.name == 'a'
+    assert e.data == 'b'
+    e = x[1]
+    assert e.name == 'c'
+    assert e.data == 'd'
+