Ejemplo n.º 1
0
    def __eq__(self, other):
        """Determines if two Notebooks are equivalent to each other (more or
        less).

        Whitespace is ignored in certain contexts (see normal.py for the
        details). The order of top-level elements (head, ipython-log, sheet) are
        currently *not* ignored although it probably should be.
        """
        return normal.c14n(self.root) == normal.c14n(other.root)
Ejemplo n.º 2
0
def test_anti_mixed():
    roots = [ET.fromstring(x) for x in anti_mixed_batch]
    str0 = normal.c14n(ET.fromstring(mixed_batch[0]))
    for i in range(len(roots)):
        assert str0 != normal.c14n(roots[i])
Ejemplo n.º 3
0
def test_mixed():
    roots = [ET.fromstring(x) for x in mixed_batch]
    str0 = normal.c14n(roots[0])
    for i in range(1, len(roots)):
        assert str0 == normal.c14n(roots[i])
Ejemplo n.º 4
0
def test_anti_stripnewline():
    roots = [ET.fromstring(x) for x in anti_stripnewline_batch]
    str0 = normal.c14n(ET.fromstring(stripnewline_batch[0]))
    for i in range(len(roots)):
        assert str0 != normal.c14n(roots[i])
Ejemplo n.º 5
0
def test_stripnewline():
    roots = [ET.fromstring(x) for x in stripnewline_batch]
    str0 = normal.c14n(roots[0])
    for i in range(1, len(roots)):
        assert str0 == normal.c14n(roots[i])