def test_index(self): BmajIndex.do_index = True prod = { "data_dir": "/tmp/test/data", "formats": { "fasta": [{ "files": ["fasta/chr1.fa", "fasta/chr2.fa"], "types": ["nucleic"], "tags": { "organism": "hg19" } }], "blast": [{ "files": ["blast/chr1/chr1db"], "types": ["nucleic"], "tags": { "chr": "chr1", "organism": "hg19" } }] }, "freeze": False, "session": 1416229253.930908, "prod_dir": "alu-2003-11-26", "release": "2003-11-26", "types": ["nucleic"] } BmajIndex.add('test', prod, True) query = {'query': {'match': {'bank': 'test'}}} res = BmajIndex.search(query) self.assertTrue(len(res) == 2)
def test_remove_all(self): self.test_index() query = { 'query' : { 'match' : {'bank': 'test'} } } BmajIndex.delete_all_bank('test') res = BmajIndex.search(query) self.assertTrue(len(res)==0)
def test_index(self): BmajIndex.do_index = True prod = { "data_dir" : "/tmp/test/data", "formats" : { "fasta" : [ { "files" : [ "fasta/chr1.fa", "fasta/chr2.fa" ], "types" : [ "nucleic" ], "tags" : { "organism" : "hg19" } } ], "blast": [ { "files" : [ "blast/chr1/chr1db" ], "types" : [ "nucleic" ], "tags" : { "chr" : "chr1", "organism" : "hg19" } } ] }, "freeze" : False, "session" : 1416229253.930908, "prod_dir" : "alu-2003-11-26", "release" : "2003-11-26", "types" : [ "nucleic" ] } BmajIndex.add('test',prod, True) query = { 'query' : { 'match' : {'bank': 'test'} } } res = BmajIndex.search(query) self.assertTrue(len(res)==2)
def test_remove_all(self): self.test_index() query = {'query': {'match': {'bank': 'test'}}} BmajIndex.delete_all_bank('test') res = BmajIndex.search(query) self.assertTrue(len(res) == 0)