Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yang-yangfeng committed Mar 26, 2019
1 parent 73a511e commit 53612c0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/integration-test/test_junctions_extract.py
Expand Up @@ -90,6 +90,18 @@ def test_no_bam(self):
rv, err = self.execute(params)
self.assertEqual(rv, 1)

def test_missing_bam(self):
output_file = self.tempFile("extract.out")
params = ["junctions", "extract", "-s 0", "-o", output_file, "does_not_exist.bam"]
rv, err = self.execute(params)
self.assertEqual(rv, 1)

def test_no_strandness(self):
output_file = self.tempFile("extract.out")
params = ["junctions", "extract", "-o", output_file]
rv, err = self.execute(params)
self.assertEqual(rv, 1)

def test_help(self):
output_file = self.tempFile("extract.out")
params = ["junctions", "extract", "-h"]
Expand Down
11 changes: 11 additions & 0 deletions tests/lib/cis-splice-effects/test_cis_splice_effects_identifier.cc
Expand Up @@ -62,6 +62,17 @@ TEST_F(CisSpliceEffectsIdentifierTest, ParseInput3) {
EXPECT_THROW(csei1.parse_options(argc, argv), common::cmdline_help_exception);
}

//Check for missing files
TEST_F(CisSpliceEffectsIdentifierTest, ParseInput5) {
int argc = 5;
char * argv[] = {"identify",
"test_does_not_exist.vcf",
"test.fa",
"test.gtf",
"test.bam"};
EXPECT_THROW(csei1.parse_options(argc, argv), std::runtime_error);
}

//Test if constructor works as expected.
TEST_F(CisSpliceEffectsIdentifierTest, ConstructorTest) {
EXPECT_EQ(csei1.vcf(), "NA");
Expand Down

0 comments on commit 53612c0

Please sign in to comment.