def test_get_double_string_right(self): all_str='Unsere Einblicke ins All : Die wichtigsten Teleskope ||| Our insights in all : The most important telescopes' src = all_str[:all_str.find('|||')].strip().split() trg = all_str[all_str.find('|||')+3:].strip().split() align = '0-0 1-1 2-2 3-3 4-4 5-5 6-6 6-7 7-8' new_line = get_double_string(src, trg, align) self.assertEqual(new_line, ['Our_Unsere', 'insights_Einblicke', 'in_ins', 'all_All', ':_:', 'The_Die', 'most_wichtigsten', 'important_wichtigsten', 'telescopes_Teleskope'])
def test_get_double_string_right(self): all_str = 'Unsere Einblicke ins All : Die wichtigsten Teleskope ||| Our insights in all : The most important telescopes' src = all_str[:all_str.find('|||')].strip().split() trg = all_str[all_str.find('|||') + 3:].strip().split() align = '0-0 1-1 2-2 3-3 4-4 5-5 6-6 6-7 7-8' new_line = get_double_string(src, trg, align) self.assertEqual(new_line, [ 'Our_Unsere', 'insights_Einblicke', 'in_ins', 'all_All', ':_:', 'The_Die', 'most_wichtigsten', 'important_wichtigsten', 'telescopes_Teleskope' ])
def test_get_double_string_wrong(self): get_double_string(['hallo', 'welt'], ['hello', ',', 'world'], '0-0 0-1 1-2 2-2')
def test_get_double_string_wrong(self): get_double_string( ['hallo','welt'], ['hello',',','world'],'0-0 0-1 1-2 2-2' )