Projects/laydi
Projects
/
laydi
Archived
7
0
Fork 0
This repository has been archived on 2024-07-04. You can view files and clone it, but cannot push or open issues or pull requests.
laydi/test/system/annotationtest.py

33 lines
910 B
Python
Raw Normal View History

import unittest
import sys
sys.path.append('../../system')
from annotations import *
from sets import Set as set
class AnnotationTest(unittest.TestCase):
def setUp(self):
pass
def testCreation(self):
a = Annotations('x', 'y')
assert a.has_dimension('x')
assert a.has_dimension('y')
assert not a.has_dimension('z')
def testAddAnnotations(self):
ann = Annotations('genes', 'go')
go = set(['GO:0', 'GO:1'])
ann.add_annotations('genes', 'BadGene', 'go', go)
genes = set(['BadGene'])
assert ann.get_annotations('genes', 'BadGene', 'go') == go
assert ann.get_annotations('go', 'GO:0', 'genes') == genes
assert ann.get_annotations('go', 'GO:1', 'genes') == genes
assert ann.get_annotations('go', 'GO:2', 'genes') == set()
if __name__ == '__main__':
unittest.main()