Skip to content

Commit

Permalink
add a test on path validations
Browse files Browse the repository at this point in the history
  • Loading branch information
Giorgio Gonnella committed Jun 18, 2020
1 parent 55b7968 commit 4e06a1c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/test_api_groups_validation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import gfapy
import unittest

class TestAPIGroupsValidation(unittest.TestCase):

def test_invalid_path_gfa2(self):
with self.assertRaises(gfapy.NotFoundError):
g = gfapy.Gfa.from_file("tests/testdata/invalid_path.gfa2")

def test_invalid_path_gfa2_vlevel0(self):
g = gfapy.Gfa.from_file("tests/testdata/invalid_path.gfa2", vlevel = 0)
with self.assertRaises(gfapy.NotFoundError):
g.validate()

def test_valid_path_gfa2(self):
# nothing raised
g = gfapy.Gfa.from_file("tests/testdata/valid_path.gfa2")
6 changes: 6 additions & 0 deletions tests/testdata/invalid_path.gfa2
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
H VN:Z:2.0
S 1 6 AGCGTA
S 2 6 TAACAG
S 3 6 GCTAGT
S 4 6 TCAGCG
O P1 1+ 2+ 3+ 5+
6 changes: 6 additions & 0 deletions tests/testdata/valid_path.gfa2
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
H VN:Z:2.0
S 1 6 AGCGTA
S 2 6 TAACAG
S 3 6 GCTAGT
S 4 6 TCAGCG
O P1 1+ 2+ 3+ 4+

0 comments on commit 4e06a1c

Please sign in to comment.