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
einarr 4bdeef05f6 * annotations.py: The Annotations class now work. Querying along any
axis is supported, but only two dimensional Annotations can be created.
2006-04-16 23:30:01 +00:00

33 lines
910 B
Python

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()