Skip to content

Commit

Permalink
added writing of test files to increase code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskoenig committed Nov 28, 2016
1 parent 84df286 commit b4a3450
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions libsbgnpy/tests/test_testfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"""
from __future__ import print_function
import unittest
import tempfile
import os
import libsbgnpy.libsbgn as libsbgn
from libsbgnpy.libsbgnTypes import Language, GlyphClass, ArcClass, Orientation

##############################################
# Test files
Expand All @@ -29,15 +29,29 @@ def find_sbgn_files(dir):


class TestSBGNFile(unittest.TestCase):
"""
Dummy test class. Test methods are attached.
"""
pass


def create_method(f):
""" Test function generator.
:param f:
:return:
"""
def f_expected(self):
print('*' * 80)
print(f)
print('*' * 80)
sbgn = libsbgn.parse(f)
self.assertTrue(sbgn is not None)

# write everything to tempfile
f_tmp = tempfile.NamedTemporaryFile(suffix=".sbgn")
sbgn.write_file(f_tmp.name)

return f_expected

# Add test functions for files
Expand All @@ -48,5 +62,4 @@ def f_expected(self):
del test_method

if __name__ == '__main__':

unittest.main()

0 comments on commit b4a3450

Please sign in to comment.