Beispiel #1
0
 def test_or_numeric_1(self):
     criteria1 = build_criteria("content.root.integer", "=", 0, "xs:int",
                                "xs")
     criteria2 = build_criteria("content.root.integer", "gte", 3, "xs:int",
                                "xs")
     criteria = ORCriteria(criteria1, criteria2)
     results = XMLdata.executeQueryFullResult(criteria)
     self.assertTrue(len(results) == 1)
Beispiel #2
0
 def test_and_numeric_3(self):
     criteria1 = build_criteria("content.root.integer", "gte", 1, "xs:int",
                                "xs")
     criteria2 = build_criteria("content.root.integer", "lte", 3, "xs:int",
                                "xs")
     criteria = ANDCriteria(criteria1, criteria2)
     results = XMLdata.executeQueryFullResult(criteria)
     self.assertTrue(len(results) == 3)
 def test_invert_and_numeric(self):
     criteria1 = build_criteria("content.root.integer", "gt", 1, "xs:int", "xs")
     criteria2 = build_criteria("content.root.integer", "lte", 3, "xs:int", "xs")
     criteria = ANDCriteria(criteria1, criteria2)
     results = XMLdata.executeQueryFullResult(criteria)
     self.assertTrue(len(results) == 2)
     inverted = invertQuery(criteria)
     inverted_results = XMLdata.executeQueryFullResult(inverted)
     self.assertTrue(len(inverted_results) == 3)
Beispiel #4
0
 def test_invert_or_numeric(self):
     criteria1 = build_criteria("content.root.integer", "gt", 1, "xs:int",
                                "xs")
     criteria2 = build_criteria("content.root.integer", "lte", 3, "xs:int",
                                "xs")
     criteria = ORCriteria(criteria1, criteria2)
     results = XMLdata.executeQueryFullResult(criteria)
     self.assertTrue(len(results) == 3)
     inverted = invertQuery(criteria)
     inverted_results = XMLdata.executeQueryFullResult(inverted)
     self.assertTrue(len(inverted_results) == 3)
 def test_invert_str(self):
     criteria = build_criteria("content.root.str", "is", "test1", "xs:string", "xs")
     results = XMLdata.executeQueryFullResult(criteria)
     self.assertTrue(len(results) == 1)
     inverted = invertQuery(criteria)
     inverted_results = XMLdata.executeQueryFullResult(inverted)
     self.assertTrue(len(inverted_results) == 2)
 def test_invert_numeric(self):
     criteria = build_criteria("content.root.integer", "=", 1, "xs:int", "xs")
     results = XMLdata.executeQueryFullResult(criteria)
     self.assertTrue(len(results) == 1)
     inverted = invertQuery(criteria)
     inverted_results = XMLdata.executeQueryFullResult(inverted)
     self.assertTrue(len(inverted_results) == 2)
Beispiel #7
0
 def test_invert_numeric(self):
     criteria = build_criteria("content.root.integer", "=", 1, "xs:int",
                               "xs")
     results = XMLdata.executeQueryFullResult(criteria)
     self.assertTrue(len(results) == 1)
     inverted = invertQuery(criteria)
     inverted_results = XMLdata.executeQueryFullResult(inverted)
     self.assertTrue(len(inverted_results) == 2)
Beispiel #8
0
 def test_invert_str(self):
     criteria = build_criteria("content.root.str", "is", "test1",
                               "xs:string", "xs")
     results = XMLdata.executeQueryFullResult(criteria)
     self.assertTrue(len(results) == 1)
     inverted = invertQuery(criteria)
     inverted_results = XMLdata.executeQueryFullResult(inverted)
     self.assertTrue(len(inverted_results) == 2)
Beispiel #9
0
 def test_decimal_not(self):
     criteria = build_criteria("content.root.float",
                               "=",
                               1,
                               "xs:float",
                               "xs",
                               isNot=True)
     results = XMLdata.executeQueryFullResult(criteria)
     self.assertTrue(len(results) == 2)
Beispiel #10
0
 def test_numeric_not(self):
     criteria = build_criteria("content.root.integer",
                               "=",
                               1,
                               "xs:int",
                               "xs",
                               isNot=True)
     results = XMLdata.executeQueryFullResult(criteria)
     self.assertTrue(len(results) == 2)
Beispiel #11
0
 def test_str_encoding(self):
     criteria = build_criteria("content.root.str",
                               "is",
                               "test",
                               "xs:string",
                               "xs",
                               isNot=True)
     results = XMLdata.executeQueryFullResult(criteria)
     self.assertTrue(len(results) == 1)
Beispiel #12
0
 def test_enum_not(self):
     criteria = build_criteria("content.root.enum",
                               "is",
                               "a",
                               "enum",
                               "xs",
                               isNot=True)
     results = XMLdata.executeQueryFullResult(criteria)
     self.assertTrue(len(results) == 2)
Beispiel #13
0
 def test_regex_not(self):
     criteria = build_criteria("content.root.str",
                               "like",
                               "test",
                               "xs:string",
                               "xs",
                               isNot=True)
     manageRegexBeforeExe(criteria)
     results = XMLdata.executeQueryFullResult(criteria)
     self.assertTrue(len(results) == 0)
Beispiel #14
0
 def test_enum_false(self):
     criteria = build_criteria("content.root.enum", "is", "d", "enum", "xs")
     results = XMLdata.executeQueryFullResult(criteria)
     self.assertTrue(len(results) == 0)
 def test_str_false(self):
     criteria = build_criteria("content.root.str", "is", "test4", "xs:string", "xs")
     results = XMLdata.executeQueryFullResult(criteria)
     self.assertTrue(len(results) == 0)
 def test_regex_not(self):
     criteria = build_criteria("content.root.str", "like", "test", "xs:string", "xs", isNot=True)
     manageRegexBeforeExe(criteria)
     results = XMLdata.executeQueryFullResult(criteria)
     self.assertTrue(len(results) == 0)
Beispiel #17
0
 def test_str_false(self):
     criteria = build_criteria("content.root.str", "is", "test4",
                               "xs:string", "xs")
     results = XMLdata.executeQueryFullResult(criteria)
     self.assertTrue(len(results) == 0)
 def test_enum_not(self):
     criteria = build_criteria("content.root.enum", "is", "a", "enum", "xs", isNot=True)
     results = XMLdata.executeQueryFullResult(criteria)
     self.assertTrue(len(results) == 2)
 def test_decimal_not(self):
     criteria = build_criteria("content.root.float", "=", 1, "xs:float", "xs", isNot=True)
     results = XMLdata.executeQueryFullResult(criteria)
     self.assertTrue(len(results) == 2)
 def test_or_numeric_3(self):
     criteria1 = build_criteria("content.root.integer", "=", 1, "xs:int", "xs")
     criteria2 = build_criteria("content.root.integer", "gte", 2, "xs:int", "xs")
     criteria = ORCriteria(criteria1, criteria2)
     results = XMLdata.executeQueryFullResult(criteria)
     self.assertTrue(len(results) == 3)
 def test_and_numeric_0(self):
     criteria1 = build_criteria("content.root.integer", "=", 0, "xs:int", "xs")
     criteria2 = build_criteria("content.root.integer", "gte", 4, "xs:int", "xs")
     criteria = ANDCriteria(criteria1, criteria2)
     results = XMLdata.executeQueryFullResult(criteria)
     self.assertTrue(len(results) == 0)
 def test_and_numeric_not(self):
     criteria1 = build_criteria("content.root.integer", "=", 1, "xs:int", "xs", isNot=True)
     criteria2 = build_criteria("content.root.integer", "lte", 3, "xs:int", "xs")
     criteria = ANDCriteria(criteria1, criteria2)
     results = XMLdata.executeQueryFullResult(criteria)
     self.assertTrue(len(results) == 2)
Beispiel #23
0
 def test_decimal_false(self):
     criteria = build_criteria("content.root.float", "=", 4, "xs:float",
                               "xs")
     results = XMLdata.executeQueryFullResult(criteria)
     self.assertTrue(len(results) == 0)
 def test_str_encoding(self):
     criteria = build_criteria("content.root.str", "is", "test", "xs:string", "xs", isNot=True)
     results = XMLdata.executeQueryFullResult(criteria)
     self.assertTrue(len(results) == 1)
 def test_enum_false(self):
     criteria = build_criteria("content.root.enum", "is", "d", "enum", "xs")
     results = XMLdata.executeQueryFullResult(criteria)
     self.assertTrue(len(results) == 0)
 def test_numeric_not(self):
     criteria = build_criteria("content.root.integer", "=", 1, "xs:int", "xs", isNot=True)
     results = XMLdata.executeQueryFullResult(criteria)
     self.assertTrue(len(results) == 2)
 def test_numeric_inferior(self):
     criteria = build_criteria("content.root.integer", "lt", 3, "xs:int", "xs")
     results = XMLdata.executeQueryFullResult(criteria)
     self.assertTrue(len(results) == 2)
Beispiel #28
0
 def test_numeric_false(self):
     criteria = build_criteria("content.root.integer", "=", 4, "xs:int",
                               "xs")
     results = XMLdata.executeQueryFullResult(criteria)
     self.assertTrue(len(results) == 0)
 def test_numeric_superior_equals(self):
     criteria = build_criteria("content.root.integer", "gte", 1, "xs:int", "xs")
     results = XMLdata.executeQueryFullResult(criteria)
     self.assertTrue(len(results) == 3)
Beispiel #30
0
 def test_numeric_inferior_equals(self):
     criteria = build_criteria("content.root.integer", "lte", 3, "xs:int",
                               "xs")
     results = XMLdata.executeQueryFullResult(criteria)
     self.assertTrue(len(results) == 3)
 def test_decimal_false(self):
     criteria = build_criteria("content.root.float", "=", 4, "xs:float", "xs")
     results = XMLdata.executeQueryFullResult(criteria)
     self.assertTrue(len(results) == 0)