class MultiStructureConnectTest(unittest.TestCase): def setUp(self): connect = open('files/simple_connect.ct', 'r') self.parser = Parser(connect) connect.close() self.loops = self.parser.indices() def test_parses_first_only(self): ans = [([9, 10, 11, 12, 13, 14, 15, 16],)] self.assertEqual(self.loops['hairpin'], ans)
class MultiStructureConnectTest(unittest.TestCase): def setUp(self): connect = open('files/simple_connect.ct', 'r') self.parser = Parser(connect) connect.close() self.loops = self.parser.indices() def test_parses_first_only(self): ans = [([9, 10, 11, 12, 13, 14, 15, 16], )] self.assertEqual(self.loops['hairpin'], ans)
class Result(object): def __init__(self, name): self._name = name + ".%s" self.parser = Connect(self.connect_file()) self.sequence = self.parser.sequence def connect_file(self): with self.__file__('ct') as f: return f.readlines() def indices(self, flanking=False): return self.parser.indices(flanking=flanking) def loops(self, flanking=False): return self.parser.loops(self.sequence, flanking=flanking) def __file__(self, extension): ext_file = self._name % extension return open(ext_file, 'r')
def test_roundtrip(self): lines = StringIO(self.connect) parser = Parser(lines) val = parser.indices()['hairpin'] ans = [([2, 3],)] self.assertEqual(val, ans)
def setUp(self): connect = open('files/simple_connect.ct', 'r') self.parser = Parser(connect) connect.close() self.loops = self.parser.indices()
def test_roundtrip(self): lines = StringIO(self.connect) parser = Parser(lines) val = parser.indices()['hairpin'] ans = [([2, 3], )] self.assertEqual(val, ans)
def __init__(self, name): self._name = name + ".%s" self.parser = Connect(self.connect_file()) self.sequence = self.parser.sequence