From 0ab73bb0673d4518c8f5a97510d7111516f1974b Mon Sep 17 00:00:00 2001 From: Mark Woon Date: Wed, 10 Jan 2024 21:38:44 -0800 Subject: [PATCH] test(reporter): update tests due to changes in data --- src/test/java/org/pharmgkb/pharmcat/ToxicGenesTest.java | 6 ++++-- .../java/org/pharmgkb/pharmcat/reporter/ReporterTest.java | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/test/java/org/pharmgkb/pharmcat/ToxicGenesTest.java b/src/test/java/org/pharmgkb/pharmcat/ToxicGenesTest.java index 1290f2192..ba207b69c 100644 --- a/src/test/java/org/pharmgkb/pharmcat/ToxicGenesTest.java +++ b/src/test/java/org/pharmgkb/pharmcat/ToxicGenesTest.java @@ -72,7 +72,8 @@ void testUncallable_partial_haplotype(TestInfo testInfo) throws Exception { void testCacna1sHomoRef(TestInfo testInfo) throws Exception { PipelineWrapper testWrapper = new PipelineWrapper(testInfo, false); testWrapper.getVcfBuilder() - .reference("CACNA1S"); + .reference("CACNA1S") + .reference("RYR1"); Path vcfFile = testWrapper.execute(null); List expectedCalls = List.of(TextConstants.HOMOZYGOUS_REFERENCE); @@ -88,6 +89,7 @@ void testCacna1sHomoRef(TestInfo testInfo) throws Exception { Document document = readHtmlReport(vcfFile); htmlChecks(document, new ImmutableMap.Builder>() .put("CACNA1S", expectedCalls) + .put("RYR1", expectedCalls) .build(), "desflurane", RecPresence.YES, RecPresence.NO); } @@ -508,7 +510,7 @@ void testRyr1HomoRefCacna1sRef(TestInfo testInfo) throws Exception { testWrapper.testPrintCalls(DataSource.CPIC, "RYR1", expectedCalls); // each gene has its own annotation so 2 CPIC annotations match, one for each gene - testWrapper.testMatchedAnnotations("desflurane", DataSource.CPIC, 2); + testWrapper.testMatchedAnnotations("desflurane", DataSource.CPIC, 1); testWrapper.testNoMatchFromSource("desflurane", DataSource.DPWG); diff --git a/src/test/java/org/pharmgkb/pharmcat/reporter/ReporterTest.java b/src/test/java/org/pharmgkb/pharmcat/reporter/ReporterTest.java index 75b3bebdf..42a2d5c21 100644 --- a/src/test/java/org/pharmgkb/pharmcat/reporter/ReporterTest.java +++ b/src/test/java/org/pharmgkb/pharmcat/reporter/ReporterTest.java @@ -28,6 +28,7 @@ void testCypc2c9VariantPassthrough() throws Exception { // test the CYP2C9 data GeneReport geneReport = reportContext.getGeneReport(DataSource.CPIC, "CYP2C9"); + assertNotNull(geneReport); assertTrue(geneReport.isReportable()); assertTrue(geneReport.isCalled()); assertFalse(geneReport.isOutsideCall()); @@ -51,7 +52,6 @@ void testCypc2c9VariantPassthrough() throws Exception { DrugReport desfluraneReport = reportContext.getDrugReports().get(DataSource.CPIC).values().stream() .filter(d -> d.getName().equals("desflurane")).findFirst() .orElseThrow(() -> new RuntimeException("No desflurane drug report found")); - // desflurane has been split in two, one for each gene - assertEquals(2, desfluraneReport.getGuidelines().stream().filter(GuidelineReport::isMatched).count()); + assertEquals(1, desfluraneReport.getGuidelines().stream().filter(GuidelineReport::isMatched).count()); } }