from tests.utils import Test, main code = ''' פעולה פיב(מ): אם מ קטןמ 3 החזר 1 אחרת: החזר פיב(מ-1) + פיב(מ-2) פלוט פיב(18) ''' test = Test(code, '2584', timeout=20) if __name__ == '__main__': main(test)
test_pos2 ] p = Popen(command, stdin=PIPE, stdout=PIPE) stdout = p.communicate()[0].decode("utf-8") self.assertEqual(p.returncode, 0) self.assertEqual(stdout, '1\tr-1-chrM\n') def test_is_blacklisted_2pos7(self): test_pos1 = 'chrM:12345(-)' test_pos2 = 'chr10:11165485(+)' regions_file = 'share/blacklist-regions.hg38.bed' junctions_file = 'share/blacklist-junctions.hg38.txt' command = [ "bin/dr-disco", "is-blacklisted", '--blacklist-regions', regions_file, '--blacklist-junctions', junctions_file, test_pos2, test_pos1 ] # swap p = Popen(command, stdin=PIPE, stdout=PIPE) stdout = p.communicate()[0].decode("utf-8") self.assertEqual(p.returncode, 0) self.assertEqual(stdout, '1\tr-1-chrM\n') if __name__ == '__main__': main()
from tests.utils import get_tests, main passed = True for name, test in get_tests().items(): print('checking', name) if not main(test): passed = False if passed: print('*'*20 + ' all tests passed ' + '*'*20) else: print('*'*20 + ' not all tests passed ' + '*'*20)