-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f68fb74
commit 84df286
Showing
3 changed files
with
43 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,52 @@ | ||
import unittest | ||
|
||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Read all the test files. | ||
""" | ||
# TODO: implement | ||
|
||
from __future__ import print_function | ||
import unittest | ||
import os | ||
import libsbgnpy.libsbgn as libsbgn | ||
from libsbgnpy.libsbgnTypes import Language, GlyphClass, ArcClass, Orientation | ||
|
||
class MyTestCase(unittest.TestCase): | ||
############################################## | ||
# Test files | ||
############################################## | ||
dir = os.path.dirname(os.path.realpath(__file__)) | ||
testfile_dir = os.path.join(dir, 'test-files') | ||
|
||
def find_sbgn_files(dir): | ||
sbgn_files = [] | ||
for root, dirs, files in os.walk(dir): | ||
for file in files: | ||
if file.endswith(".sbgn"): | ||
f = os.path.join(root, file) | ||
sbgn_files.append(f) | ||
return sbgn_files | ||
|
||
sbgn_files = find_sbgn_files(dir=testfile_dir) | ||
############################################## | ||
|
||
|
||
class TestSBGNFile(unittest.TestCase): | ||
pass | ||
|
||
def create_method(f): | ||
def f_expected(self): | ||
print('*' * 80) | ||
print(f) | ||
print('*' * 80) | ||
sbgn = libsbgn.parse(f) | ||
self.assertTrue(sbgn is not None) | ||
return f_expected | ||
|
||
# Add test functions for files | ||
for k, f in enumerate(sbgn_files): | ||
test_method = create_method(f) | ||
test_method.__name__ = 'test_%s' % k | ||
setattr(TestSBGNFile, test_method.__name__, test_method) | ||
del test_method | ||
|
||
if __name__ == '__main__': | ||
|
||
unittest.main() |