root/livinglogic.python.xist/test/test_location.py @ 2590:7b6bba35f3a0

Revision 2590:7b6bba35f3a0, 1.2 KB (checked in by Walter Doerwald <walter@…>, 13 years ago)

htmlspecials.pixel() now no longer uses colored pixels, instead color is
done via CSS. The URL for the one remaining transparent pixel can now be
specified via src (either as an XML attribute or via the converter context).

Rename attrs methods with() and without() to withnames() and withoutnames()
(for Python 2.5 compatibility).

Use elinks instead of w3m for asText() and move/rename this method to a
function ll.xist.ns.html.astext().

Try to make XIST independent from PyXML (however PyXML is still required
for parsing via expat and for dtd2xsc.py (because this requires xmlproc)).

Remove the long dperecated method withSep().

Use Py_ssize_t in the C source where appropriate.

  • Property exe set to *
Line 
1#! /usr/bin/env/python
2# -*- coding: iso-8859-1 -*-
3
4## Copyright 1999-2006 by LivingLogic AG, Bayreuth/Germany.
5## Copyright 1999-2006 by Walter Dörwald
6##
7## All Rights Reserved
8##
9## See xist/__init__.py for the license
10
11
12from ll.xist import xsc
13
14
15def test_locationeq():
16    l1 = xsc.Location(sysid="gurk", pubid="http://gurk.com", line=42, col=666)
17    l2 = xsc.Location(sysid="gurk", pubid="http://gurk.com", line=42, col=666)
18    l3 = xsc.Location(sysid="hurz", pubid="http://gurk.com", line=42, col=666)
19    l4 = xsc.Location(sysid="gurk", pubid="http://hurz.com", line=42, col=666)
20    l5 = xsc.Location(sysid="gurk", pubid="http://gurk.com", line=43, col=666)
21    l6 = xsc.Location(sysid="gurk", pubid="http://gurk.com", line=43, col=667)
22    l7 = xsc.Location(sysid="gurk", pubid="http://gurk.com")
23    assert l1 == l2
24    assert l1 != l3
25    assert l1 != l4
26    assert l1 != l5
27    assert l1 != l6
28    assert l1 != l7
29
30
31def test_locationoffset():
32    l1 = xsc.Location(sysid="gurk", pubid="http://gurk.com", line=42, col=666)
33    assert l1 == l1.offset(0)
34    l2 = l1.offset(1)
35    assert l1.getSystemId() == l2.getSystemId()
36    assert l1.getPublicId() == l2.getPublicId()
37    assert l1.getLineNumber()+1 == l2.getLineNumber()
Note: See TracBrowser for help on using the browser.