* annotations.py: The Annotations class now work. Querying along any
axis is supported, but only two dimensional Annotations can be created.
This commit is contained in:
@@ -3,6 +3,7 @@ import unittest
|
||||
import sys
|
||||
sys.path.append('../../system')
|
||||
from annotations import *
|
||||
from sets import Set as set
|
||||
|
||||
class AnnotationTest(unittest.TestCase):
|
||||
|
||||
@@ -11,9 +12,21 @@ class AnnotationTest(unittest.TestCase):
|
||||
|
||||
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()
|
||||
|
Reference in New Issue
Block a user