def test_get__tab(self): from clld.lib.iso import get_tab with patch.multiple( "clld.lib.iso", requests=self._requests("a\tb\nc\td\naa"), get_taburls=Mock(return_value={"name": "path"}) ): res = list(get_tab("name")) assert res[-1].b is None
def test_get__tab(self): from clld.lib.iso import get_tab with patch.multiple('clld.lib.iso', requests=self._requests('a\tb\nc\td\naa'), get_taburls=Mock(return_value={'name': 'path'})): res = list(get_tab('name')) assert res[-1].b is None
def macrolanguages(args): codes = {row[0] for row in DBSession.query(Languoid.hid).filter(Languoid.hid != None) if len(row[0]) == 3} macrolangs = defaultdict(list) for code in get_tab('macrolanguages'): if code.I_Id in codes: macrolangs[code.M_Id].append(code.I_Id) return macrolangs
def test_get__tab(self): from clld.lib.iso import get_tab with patch.multiple( 'clld.lib.iso', requests=self._requests('a\tb\nc\td\naa'), get_taburls=Mock(return_value={'name': 'path'}) ): res = list(get_tab('name')) assert res[-1].b is None
def macrolanguages(args): codes = { row[0] for row in DBSession.query(Languoid.hid).filter(Languoid.hid != None) if len(row[0]) == 3 } macrolangs = defaultdict(list) for code in get_tab('macrolanguages'): if code.I_Id in codes: macrolangs[code.M_Id].append(code.I_Id) return macrolangs
def get_macrolangs(codes): for code in iso.get_tab('macrolanguages'): if code.i_id in codes: yield code.m_id, code.i_id