Exemplo n.º 1
0
 def test_intersection_with_intersection(self):
     a, b, c, d = Query(), Query(), Query(), Query()
     self.check_both(a & b, c & d, Intersection(a, b, c, d))
Exemplo n.º 2
0
 def test_intersection_query_with_its_inversion(self):
     q = Query()
     self.check_both(q, ~q, ~Q())
Exemplo n.º 3
0
 def test_query_with_intersection(self):
     a, b, c = Query(), Query(), Query()
     self.check_both(a & b, c, Intersection(a, b, c))
Exemplo n.º 4
0
 def test_intersection_everything(self):
     q = Query()
     self.check_both(Q(), q, q)
Exemplo n.º 5
0
 def test_intersection_nothing(self):
     self.check_both(~Q(), Query(), ~Q())
Exemplo n.º 6
0
 def test_query_with_union(self):
     a, b, c = Query(), Query(), Query()
     self.check_both(a | b, c, Union(a, b, c))
Exemplo n.º 7
0
 def test_union_with_union(self):
     a, b, c, d = Query(), Query(), Query(), Query()
     self.check_both(a | b, c | d, Union(a, b, c, d))
Exemplo n.º 8
0
 def test_with_nothing(self):
     q = Query()
     self.check_both(~Q(), q, q)
Exemplo n.º 9
0
 def test_with_everything(self):
     self.check_both(Q(), Query(), Q())
Exemplo n.º 10
0
 def test_inversion(self):
     q = Query()
     assert_is_instance(~q, Inversion)
     eq_((~q).subquery, q)
Exemplo n.º 11
0
 def test_intersection(self):
     a, b = Query(), Query()
     q = a & b
     assert_is_instance(q, Intersection)
     assert_set_equal(q.subqueries, set((a, b)))
Exemplo n.º 12
0
 def test_union(self):
     a, b = Query(), Query()
     q = a | b
     assert_is_instance(q, Union)
     assert_set_equal(q.subqueries, set((a, b)))