Beispiel #1
0
 def test_filtering_on_common_attribute(self):
     filters = {"common-attr": ["common"]}
     filtered_resources = apply_filter(self.resources, filters,
                                       self.filter_defs)
     filtered_resources.should.have.length_of(2)
     filtered_resources.should.have.key("identifier-1")
     filtered_resources.should.have.key("identifier-4")
Beispiel #2
0
 def test_filtering_on_multiple_attributes(self):
     filters = {"multiple-attrs": ["common"]}
     filtered_resources = apply_filter(self.resources, filters,
                                       self.filter_defs)
     filtered_resources.should.have.length_of(3)
     filtered_resources.should.have.key("identifier-1")
     filtered_resources.should.have.key("identifier-4")
     filtered_resources.should.have.key("identifier-5")
Beispiel #3
0
 def test_filters_with_multiple_values(self):
     filters = {
         "identifier": ["identifier-0", "identifier-3", "identifier-5"]
     }
     filtered_resources = apply_filter(self.resources, filters,
                                       self.filter_defs)
     filtered_resources.should.have.length_of(3)
     filtered_resources.should.have.key("identifier-0")
     filtered_resources.should.have.key("identifier-3")
     filtered_resources.should.have.key("identifier-5")
Beispiel #4
0
 def test_multiple_filters(self):
     filters = {
         "identifier": ["identifier-1", "identifier-3", "identifier-5"],
         "common-attr": ["common"],
         "multiple-attrs": ["common"],
     }
     filtered_resources = apply_filter(self.resources, filters,
                                       self.filter_defs)
     filtered_resources.should.have.length_of(1)
     filtered_resources.should.have.key("identifier-1")
Beispiel #5
0
 def test_filtering_on_nested_attribute(self):
     filters = {"nested-resource": ["nested-id-1"]}
     filtered_resources = apply_filter(self.resources, filters,
                                       self.filter_defs)
     filtered_resources.should.have.length_of(1)
     filtered_resources.should.have.key("identifier-3")