Example #1
0
class TestCanon95(unittest.TestCase, CanonNotEqualTest):
    def setUp(self):
        self.a = Expression()
        self.a.decapitate("onelevel")

        self.b = Expression()
        self.b.decapitate("onelevel", reverse=True)
Example #2
0
class TestCanon95(unittest.TestCase, CanonNotEqualTest):
    def setUp(self):
        self.a = Expression()
        self.a.decapitate("onelevel")

        self.b = Expression()
        self.b.decapitate("onelevel", reverse=True)
Example #3
0
 def test_plus_is_conmutative(self):
     other = Expression()
     other.decapitate("blabla")
     a = self.e + other
     b = other + self.e
     self.assertEqual(make_canonical_expression(a),
                      make_canonical_expression(b))
Example #4
0
 def test_plus_is_conmutative2(self):
     other = Expression()
     other.decapitate("blabla")
     a = self.e + other + self.e
     b = other + self.e + self.e
     self.assertEqual(make_canonical_expression(a),
                      make_canonical_expression(b))
Example #5
0
 def test_merges2(self):
     other = Expression()
     other.decapitate("blabla")
     oldlen = len(other)
     oldhead = other.get_head()
     other.merge(self.e)
     self.assertEqual(other.get_head(), oldhead)
     self.assertEqual(len(other), oldlen + len(self.e) - 1)
Example #6
0
 def test_merges1(self):
     oldlen = len(self.e)
     oldhead = self.e.get_head()
     other = Expression()
     other.decapitate("blabla")
     self.e.merge(other)
     self.assertEqual(self.e.get_head(), oldhead)
     self.assertEqual(len(self.e), oldlen + len(other) - 1)
Example #7
0
 def test_merges1(self):
     oldlen = len(self.e)
     oldhead = self.e.get_head()
     other = Expression()
     other.decapitate("blabla")
     self.e.merge(other)
     self.assertEqual(self.e.get_head(), oldhead)
     self.assertEqual(len(self.e), oldlen + len(other) - 1)
Example #8
0
 def test_merges2(self):
     other = Expression()
     other.decapitate("blabla")
     oldlen = len(other)
     oldhead = other.get_head()
     other.merge(self.e)
     self.assertEqual(other.get_head(), oldhead)
     self.assertEqual(len(other), oldlen + len(self.e) - 1)
Example #9
0
 def setUp(self):
     A = Expression()
     A.add_data("bla", "somedata")
     A.decapitate("hier")
     B = Expression()
     B.add_data("ble", "otherdata")
     B.decapitate("hier")
     self.a = A + B
     self.b = B + A
Example #10
0
 def setUp(self):
     A = Expression()
     A.add_data("bla", "somedata")
     A.decapitate("hier")
     B = Expression()
     B.add_data("ble", "otherdata")
     B.decapitate("hier")
     self.a = A + B
     self.b = B + A
Example #11
0
 def setUp(self):
     self.e = Expression()
     self.e.add_data(123, "456")
     other = Expression()
     other.add_data(0, "1")
     other.add_data(2, "3")
     other.decapitate("iuju")
     for _ in xrange(5):
         self.e.decapitate("nouu")
         self.e += other
Example #12
0
class TestExpression3(unittest.TestCase, ExpressionTests):
    def setUp(self):
        self.e = Expression()
        self.e.add_data("key", "1")
        self.e.decapitate(u"µ")
        self.e.add_data("a", "2")
        self.e.add_data("a", "3")
        self.e.add_data(None, None)
        self.e.decapitate(None)
        self.e.add_data(None, None)
Example #13
0
class TestExpression3(unittest.TestCase, ExpressionTests):
    def setUp(self):
        self.e = Expression()
        self.e.add_data("key", "1")
        self.e.decapitate(u"µ")
        self.e.add_data("a", "2")
        self.e.add_data("a", "3")
        self.e.add_data(None, None)
        self.e.decapitate(None)
        self.e.add_data(None, None)
Example #14
0
 def setUp(self):
     self.e = Expression()
     self.e.add_data(123, "456")
     other = Expression()
     other.add_data(0, "1")
     other.add_data(2, "3")
     other.decapitate("iuju")
     for _ in xrange(5):
         self.e.decapitate("nouu")
         self.e += other
Example #15
0
class TestExpression4(unittest.TestCase, ExpressionTests):
    def setUp(self):
        self.e = Expression()
        self.e.add_data(123, "456")
        other = Expression()
        other.add_data(0, "1")
        other.add_data(2, "3")
        other.decapitate("iuju")
        for _ in xrange(5):
            self.e.decapitate("nouu")
            self.e += other
Example #16
0
class TestExpression4(unittest.TestCase, ExpressionTests):
    def setUp(self):
        self.e = Expression()
        self.e.add_data(123, "456")
        other = Expression()
        other.add_data(0, "1")
        other.add_data(2, "3")
        other.decapitate("iuju")
        for _ in xrange(5):
            self.e.decapitate("nouu")
            self.e += other
Example #17
0
    def setUp(self):
        other = Expression()
        other.decapitate("onelevel")
        self.a = Expression()
        for _ in xrange(5):
            self.a.decapitate("step")
            self.a += other

        other = Expression()
        other.decapitate("onelevel", reverse=True)
        self.b = Expression()
        for _ in xrange(5):
            self.b.decapitate("step")
            self.b += other
Example #18
0
    def setUp(self):
        other = Expression()
        other.decapitate("onelevel")
        self.a = Expression()
        for _ in xrange(5):
            self.a.decapitate("step")
            self.a += other

        other = Expression()
        other.decapitate("onelevel", reverse=True)
        self.b = Expression()
        for _ in xrange(5):
            self.b.decapitate("step")
            self.b += other
Example #19
0
class TestCanon97(unittest.TestCase, CanonNotEqualTest):
    def setUp(self):
        other = Expression()
        other.decapitate("onelevel")
        self.a = Expression()
        for _ in xrange(5):
            self.a.decapitate("step")
            self.a += other

        other = Expression()
        other.decapitate("onelevel", reverse=True)
        self.b = Expression()
        for _ in xrange(5):
            self.b.decapitate("step")
            self.b += other
Example #20
0
class TestCanon97(unittest.TestCase, CanonNotEqualTest):
    def setUp(self):
        other = Expression()
        other.decapitate("onelevel")
        self.a = Expression()
        for _ in xrange(5):
            self.a.decapitate("step")
            self.a += other

        other = Expression()
        other.decapitate("onelevel", reverse=True)
        self.b = Expression()
        for _ in xrange(5):
            self.b.decapitate("step")
            self.b += other
Example #21
0
 def setUp(self):
     A = Expression()
     A.add_data("bla", "somedata")
     A.decapitate("hier")
     B = Expression()
     B.add_data("ble", "otherdata")
     B.decapitate("hier")
     C = A + B
     C.decapitate("hier")
     C += B
     C.decapitate("hier")
     self.a = C + A
     D = B + A
     D.decapitate("hier")
     D += B
     D.decapitate("hier")
     self.b = D + A
Example #22
0
 def setUp(self):
     A = Expression()
     A.add_data("bla", "somedata")
     A.decapitate("hier")
     B = Expression()
     B.add_data("ble", "otherdata")
     B.decapitate("hier")
     C = A + B
     C.decapitate("hier")
     C += B
     C.decapitate("hier")
     self.a = C + A
     D = B + A
     D.decapitate("hier")
     D += B
     D.decapitate("hier")
     self.b = D + A
Example #23
0
 def test_plus_makes_copy(self):
     other = Expression()
     other.decapitate("blabla")
     a = self.e + other
     self.assertFalse(a is other or self.e is other or a is self.e)
Example #24
0
class TestCanon99(unittest.TestCase, CanonNotEqualTest):
    def setUp(self):
        self.a = Expression()
        self.b = Expression()
        self.b.decapitate("relation")
Example #25
0
class TestCanon99(unittest.TestCase, CanonNotEqualTest):
    def setUp(self):
        self.a = Expression()
        self.b = Expression()
        self.b.decapitate("relation")
Example #26
0
 def test_plus_makes_copy(self):
     other = Expression()
     other.decapitate("blabla")
     a = self.e + other
     self.assertFalse(a is other or self.e is other or a is self.e)