def test_negative_facet(): conn = SearchConnection(TEST_SERVICE) context = conn.new_context(project='CMIP5', model='IPSL-CM5A-LR') hits1 = context.hit_count print context.facet_counts['experiment'] context2 = context.constrain(experiment='historical') hits2 = context2.hit_count context3 = context.constrain(experiment=not_equals('historical')) hits3 = context3.hit_count assert hits1 == hits2 + hits3
def test_negative_facet(self): conn = SearchConnection(self.test_service, cache=self.cache) context = conn.new_context(project='CMIP5', model='IPSL-CM5A-LR') hits1 = context.hit_count print(context.facet_counts['experiment']) context2 = context.constrain(experiment='historical') hits2 = context2.hit_count context3 = context.constrain(experiment=not_equals('historical')) hits3 = context3.hit_count assert hits1 == hits2 + hits3
def test_negative_facet(self): conn = SearchConnection(self.test_service, cache=self.cache) context = conn.new_context(project='CMIP5', model='IPSL-CM5A-LR') hits1 = context.hit_count print(context.facet_counts['experiment']) context2 = context.constrain(experiment='historical') hits2 = context2.hit_count context3 = context.constrain(experiment=not_equals('historical')) hits3 = context3.hit_count self.assertTrue(hits1 == hits2 + hits3)