Skip to content

Commit

Permalink
chore: example_foler -> example_folder
Browse files Browse the repository at this point in the history
  • Loading branch information
ariutta committed Jun 15, 2021
1 parent dc2b8fc commit 78c4320
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
12 changes: 6 additions & 6 deletions __test__/integration/TRAPIv1.1.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ var path = require('path');


describe("Testing v1.1 endpoints", () => {
const example_foler = path.resolve(__dirname, '../../examples/v1.1');
const example_folder = path.resolve(__dirname, '../../examples/v1.1');
const clinical_risk_kp_folder = path.resolve(__dirname, '../../examples/v1.1/multiomics/clinical_risk_kp');
const old_spec_folder = path.resolve(__dirname, "../../examples/v0.9.2");
const invalid_example_folder = path.resolve(__dirname, "../../examples/v1.1/invalid");
const drug2disease_query = JSON.parse(fs.readFileSync(path.join(clinical_risk_kp_folder, 'query_drug_to_disease.json')));
const gene2chemical_query = JSON.parse(fs.readFileSync(path.join(example_foler, 'query_chemicals_physically_interacts_with_genes.json')));
const disease2gene_query = JSON.parse(fs.readFileSync(path.join(example_foler, 'query_genes_relate_to_disease.json')));
const gene2chemical_query = JSON.parse(fs.readFileSync(path.join(example_folder, 'query_chemicals_physically_interacts_with_genes.json')));
const disease2gene_query = JSON.parse(fs.readFileSync(path.join(example_folder, 'query_genes_relate_to_disease.json')));
const query_using_earlier_trapi_spec = JSON.parse(fs.readFileSync(path.join(old_spec_folder, 'query_genes_relate_to_disease.json')));
const query_without_category = JSON.parse(fs.readFileSync(path.join(example_foler, 'query_without_input_category.json')))
const expand_node = JSON.parse(fs.readFileSync(path.join(example_foler, 'query_with_node_to_be_expanded.json')))
const query_without_category = JSON.parse(fs.readFileSync(path.join(example_folder, 'query_without_input_category.json')))
const expand_node = JSON.parse(fs.readFileSync(path.join(example_folder, 'query_with_node_to_be_expanded.json')))

test("GET /v1/meta_knowledge_graph", async () => {
await request(app)
Expand Down Expand Up @@ -226,4 +226,4 @@ describe("Testing v1.1 endpoints", () => {
// })
// })

})
})
12 changes: 6 additions & 6 deletions __test__/integration/TRAPIv1.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ var path = require('path');

//V1 tests are now skipped.
describe.skip("Testing v1 endpoints", () => {
const example_foler = path.resolve(__dirname, '../../examples/v1');
const example_folder = path.resolve(__dirname, '../../examples/v1');
const clinical_risk_kp_folder = path.resolve(__dirname, '../../examples/v1/multiomics/clinical_risk_kp');
const old_spec_folder = path.resolve(__dirname, "../../examples/v0.9.2");
const invalid_example_folder = path.resolve(__dirname, "../../examples/v1/invalid");
const drug2disease_query = JSON.parse(fs.readFileSync(path.join(clinical_risk_kp_folder, 'query_drug_to_disease.json')));
const gene2chemical_query = JSON.parse(fs.readFileSync(path.join(example_foler, 'query_chemicals_physically_interacts_with_genes.json')));
const disease2gene_query = JSON.parse(fs.readFileSync(path.join(example_foler, 'query_genes_relate_to_disease.json')));
const gene2chemical_query = JSON.parse(fs.readFileSync(path.join(example_folder, 'query_chemicals_physically_interacts_with_genes.json')));
const disease2gene_query = JSON.parse(fs.readFileSync(path.join(example_folder, 'query_genes_relate_to_disease.json')));
const query_using_earlier_trapi_spec = JSON.parse(fs.readFileSync(path.join(old_spec_folder, 'query_genes_relate_to_disease.json')));
const query_without_category = JSON.parse(fs.readFileSync(path.join(example_foler, 'query_without_input_category.json')))
const expand_node = JSON.parse(fs.readFileSync(path.join(example_foler, 'query_with_node_to_be_expanded.json')))
const query_without_category = JSON.parse(fs.readFileSync(path.join(example_folder, 'query_without_input_category.json')))
const expand_node = JSON.parse(fs.readFileSync(path.join(example_folder, 'query_with_node_to_be_expanded.json')))

test("GET /v1/predicates", async () => {
await request(app)
Expand Down Expand Up @@ -139,4 +139,4 @@ describe.skip("Testing v1 endpoints", () => {
// })
// })

})
})
12 changes: 6 additions & 6 deletions __test__/integration/routes/v1query_by_api.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var path = require('path');

describe("Testing /v1/smartapi/{smartapi_id}/query endpoints", () => {
const invalid_example_folder = path.resolve(__dirname, "../../../examples/v1.1/invalid");
const example_foler = path.resolve(__dirname, '../../../examples/v1.1');
const example_folder = path.resolve(__dirname, '../../../examples/v1.1');
test("Input query graph that doesn't pass Swagger Validation should return 400 error", async () => {
const InvalidInputQueryGraph = {
message1: 1
Expand Down Expand Up @@ -62,7 +62,7 @@ describe("Testing /v1/smartapi/{smartapi_id}/query endpoints", () => {
})

test("Query to Text Mining Targeted Association KP should have id resolution turned off", async () => {
const query = JSON.parse(fs.readFileSync(path.join(example_foler, "textmining/query_chemicals_related_to_gene_or_gene_product.json")));
const query = JSON.parse(fs.readFileSync(path.join(example_folder, "textmining/query_chemicals_related_to_gene_or_gene_product.json")));
await request(app)
.post("/v1/smartapi/978fe380a147a8641caf72320862697b/query/")
.send(query)
Expand All @@ -76,7 +76,7 @@ describe("Testing /v1/smartapi/{smartapi_id}/query endpoints", () => {
})

test("Query to Text Mining Targeted Association KP should have id resolution turned off", async () => {
const query = JSON.parse(fs.readFileSync(path.join(example_foler, "textmining/query_chemicals_related_to_gene_or_gene_product.json")));
const query = JSON.parse(fs.readFileSync(path.join(example_folder, "textmining/query_chemicals_related_to_gene_or_gene_product.json")));
await request(app)
.post("/v1/smartapi/978fe380a147a8641caf72320862697b/query/")
.send(query)
Expand All @@ -90,7 +90,7 @@ describe("Testing /v1/smartapi/{smartapi_id}/query endpoints", () => {
})

test("Query to non-Text Mining KPs should have id resolution turned on", async () => {
const query = JSON.parse(fs.readFileSync(path.join(example_foler, "serviceprovider/mychem.json")));
const query = JSON.parse(fs.readFileSync(path.join(example_folder, "serviceprovider/mychem.json")));
await request(app)
.post("/v1/smartapi/8f08d1446e0bb9c2b323713ce83e2bd3/query")
.send(query)
Expand All @@ -103,7 +103,7 @@ describe("Testing /v1/smartapi/{smartapi_id}/query endpoints", () => {
})

test("Query to Text Mining Co-occurrence KP should be correctly paginated", async () => {
const query = JSON.parse(fs.readFileSync(path.join(example_foler, "textmining/query_chemicals_related_to_disease.json")));
const query = JSON.parse(fs.readFileSync(path.join(example_folder, "textmining/query_chemicals_related_to_disease.json")));
const apiResponse = await axios.get('https://biothings.ncats.io/text_mining_co_occurrence_kp/query?q=object.id:%22MONDO:0005252%22%20AND%20subject.type:%22ChemicalSubstance%22');
const hits = apiResponse.data.total;
await request(app)
Expand All @@ -117,4 +117,4 @@ describe("Testing /v1/smartapi/{smartapi_id}/query endpoints", () => {
expect(Object.keys(response.body.message.knowledge_graph.nodes)).toHaveLength(hits + 1)
})
})
})
})
10 changes: 5 additions & 5 deletions __test__/integration/routes/v1query_by_team.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var path = require('path');

describe("Testing /v1/team/{team_name}/query endpoints", () => {
const invalid_example_folder = path.resolve(__dirname, "../../../examples/v1.1/invalid");
const example_foler = path.resolve(__dirname, '../../../examples/v1.1');
const example_folder = path.resolve(__dirname, '../../../examples/v1.1');
test("Input query graph that doesn't pass Swagger Validation should return 400 error", async () => {
const InvalidInputQueryGraph = {
message1: 1
Expand Down Expand Up @@ -62,7 +62,7 @@ describe("Testing /v1/team/{team_name}/query endpoints", () => {
})

test("Query to Text Mining KPs should have id resolution turned off", async () => {
const query = JSON.parse(fs.readFileSync(path.join(example_foler, "textmining/query_chemicals_related_to_gene_or_gene_product.json")));
const query = JSON.parse(fs.readFileSync(path.join(example_folder, "textmining/query_chemicals_related_to_gene_or_gene_product.json")));
await request(app)
.post("/v1/team/Text Mining Provider/query/")
.send(query)
Expand All @@ -76,7 +76,7 @@ describe("Testing /v1/team/{team_name}/query endpoints", () => {
})

test("Query to Service Provider KPs should have id resolution turned on", async () => {
const query = JSON.parse(fs.readFileSync(path.join(example_foler, "textmining/query_chemicals_related_to_gene_or_gene_product.json")));
const query = JSON.parse(fs.readFileSync(path.join(example_folder, "textmining/query_chemicals_related_to_gene_or_gene_product.json")));
await request(app)
.post("/v1/team/Service Provider/query/")
.send(query)
Expand All @@ -93,7 +93,7 @@ describe("Testing /v1/team/{team_name}/query endpoints", () => {
})

test("Query to Text Mining Co-occurrence KP should be correctly paginated", async () => {
const query = JSON.parse(fs.readFileSync(path.join(example_foler, "textmining/query_chemicals_related_to_disease.json")));
const query = JSON.parse(fs.readFileSync(path.join(example_folder, "textmining/query_chemicals_related_to_disease.json")));
const apiResponse = await axios.get('https://biothings.ncats.io/text_mining_co_occurrence_kp/query?q=object.id:%22MONDO:0005252%22%20AND%20subject.type:%22ChemicalSubstance%22');
const hits = apiResponse.data.total;
await request(app)
Expand All @@ -107,4 +107,4 @@ describe("Testing /v1/team/{team_name}/query endpoints", () => {
expect(Object.keys(response.body.message.knowledge_graph.nodes)).toHaveLength(hits + 1)
})
})
})
})

0 comments on commit 78c4320

Please sign in to comment.