示例#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))
示例#2
0
 def test_intersection_query_with_its_inversion(self):
     q = Query()
     self.check_both(q, ~q, ~Q())
示例#3
0
 def test_query_with_intersection(self):
     a, b, c = Query(), Query(), Query()
     self.check_both(a & b, c, Intersection(a, b, c))
示例#4
0
 def test_intersection_everything(self):
     q = Query()
     self.check_both(Q(), q, q)
示例#5
0
 def test_intersection_nothing(self):
     self.check_both(~Q(), Query(), ~Q())
示例#6
0
 def test_query_with_union(self):
     a, b, c = Query(), Query(), Query()
     self.check_both(a | b, c, Union(a, b, c))
示例#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))
示例#8
0
 def test_with_nothing(self):
     q = Query()
     self.check_both(~Q(), q, q)
示例#9
0
 def test_with_everything(self):
     self.check_both(Q(), Query(), Q())
示例#10
0
 def test_inversion(self):
     q = Query()
     assert_is_instance(~q, Inversion)
     eq_((~q).subquery, q)
示例#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)))
示例#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)))