Hello,
The following is the Body of the response:
{
"downloadTime": "2021:03:17T17:52:21Z",
"downloadTimeStamp": 1616003541,
"genome": "hg38",
"chrom": "chrX",
"start": 51657026,
"end": 51658026,
"dna": "tatgacgtaactatccatttatttagatcatcctcaaaaatatctcagtacaattttcagtgtatagattttgccaccttttgtgagatttatccctaagtatttcatgtttttaatgttatcatgctggtatttttatttaaatatcaaattgtttgttagtaatatatagaacggcaagtgatttttatagatatagcaagggggttttttgcagattctataggattattttatagagatgatcacatcttcatagacaaaagagacagttttacttaccgctttccaagtttttcttctgacccttttattaacattttttcttgtattattgcactagttagattaagcggtggacaacatatttgcccacttttttttcattttaagaggtaagtactcagtcttcatcactacatttcaagttacctgtaggtttttcatagatgccatttccttatcaagttgaggaagattgcttctgtttctagtttggtaagagttttaccaggaatgaatgctggatttgccaaatgatgtttctgcgtctattaaaatgactattttacaaatctgttaatattgtgaattacattgatttgtttttctaaggttaaactacctttgcattctttggtcatgatgcattatccttttccccaggtaatactggcttcgtacaatgagtcaggaaatattccatttctttaattttctggaaaaaaaattctgtgggtggcattatttcttccttatatgattagtagaatccacaagtaaatccatctgggcctttaattttctttgtggaaggttttaaagtagaagcttaatgtattgaagagtgttttaatcacctcctatttatcccattagtgagggagggattcctgcctaggtttaggcaaatggctggcgtatgacacgacaccggacacatgagactgttagcaatttattagtaatgtatactcacaacctgagagaggaggatacc"
}
I have 2 questions:
1- I need to check if the “dna” contains at least 10 “Ngg” sites. That means if there are a minimum of 10 [acgt]gg sites (agg or cgg or tgg or ggg). How do I write a test for that?
2- Is the following test for validating schema correct?
const schema = {
"downloadTime": "data-time",
"genome": "{{human genome}}", //human genome is a collection level variable
"chrom": ("chrX"|"chrY"),
};
pm.test('Schema is valid', function() {
pm.response.to.have.jsonSchema(schema);
});
Many thanks for your help!