<commit_before>#! /usr/bin/env python
from peyotl.api import OTI
from peyotl.test.support.pathmap import get_test_ot_service_domains
from peyotl.utility import get_logger
import sys
import unittest

_LOG = get_logger(__name__)

@unittest.skip("test skipped")
class TestOTI(unittest.TestCase):
    def setUp(self):
        d = get_test_ot_service_domains()
        self.oti = OTI(d)
    def testFindAllStudies(self):
        x = self.oti.find_all_studies(verbose=True)
        self.assertTrue(len(x) > 0)
        self.assertTrue('ot:studyId' in x[0])
    @unittest.skip("test skipped because OTI's study search appears to be broken. https://github.com/OpenTreeOfLife/oti/issues/19")
    def testStudyTerms(self):
        t_set = self.oti.study_search_term_set
        r = self.oti.find_studies({'ot:studyPublication': '10.1073/pnas.0709121104'})
        print r
    def testNodeTerms(self):
        t_set = self.oti.node_search_term_set
        nl = self.oti.find_nodes(originalLabel='Aponogeoton ulvaceus 1 2')
        self.assertTrue(len(nl) > 0)
        f = nl[0]
        self.assertTrue('matched_trees' in f)
        t = f['matched_trees']
        self.assertTrue(len(t) > 0)
        tr = t[0]
        self.assertTrue('matched_nodes' in tr)
        n = tr['matched_nodes']
        self.assertTrue(len(n) > 0)<commit_msg>reinstating oti tests<commit_after>#! /usr/bin/env python
from peyotl.api import OTI
from peyotl.test.support.pathmap import get_test_ot_service_domains
from peyotl.utility import get_logger
import sys
import unittest

_LOG = get_logger(__name__)


class TestOTI(unittest.TestCase):
    def setUp(self):
        d = get_test_ot_service_domains()
        self.oti = OTI(d)
    def testFindAllStudies(self):
        x = self.oti.find_all_studies(verbose=True)
        self.assertTrue(len(x) > 0)
        self.assertTrue('ot:studyId' in x[0])
    @unittest.skip("test skipped because OTI's study search appears to be broken. https://github.com/OpenTreeOfLife/oti/issues/19")
    def testStudyTerms(self):
        t_set = self.oti.study_search_term_set
        r = self.oti.find_studies({'ot:studyPublication': '10.1073/pnas.0709121104'})
        print r
    def testNodeTerms(self):
        t_set = self.oti.node_search_term_set
        nl = self.oti.find_nodes(originalLabel='Aponogeoton ulvaceus 1 2')
        self.assertTrue(len(nl) > 0)
        f = nl[0]
        self.assertTrue('matched_trees' in f)
        t = f['matched_trees']
        self.assertTrue(len(t) > 0)
        tr = t[0]
        self.assertTrue('matched_nodes' in tr)
        n = tr['matched_nodes']
        self.assertTrue(len(n) > 0)
{'fraction_non_alphanumeric': 0.11585365853658537, 'fraction_numerical': 0.020579268292682928, 'mean_word_length': 3.120879120879121, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3064971', 'n_tokens_mistral': 958, 'n_tokens_neox': 918, 'n_words': 177}