예제 #1
0
파일: cli.py 프로젝트: ICIJ/es-translator
def pairs(data_dir, local, syslog_address, syslog_port, syslog_facility,
          **options):
    # Configure Syslog handler
    add_syslog_handler(syslog_address, syslog_port, syslog_facility)
    add_stdout_handler(options['stdout_loglevel'])
    # Only the data-dir is needed to construct the Apertium instance, then
    # we just need to print the pair
    Pairs(data_dir, local).print_pairs()
예제 #2
0
 def test_print_only_remote_pairs(self, mock_print):
     pairs = Pairs(data_dir=data_dir, local=False)
     pairs.print_pairs()
     mock_print.assert_called_with('\n'.join(pairs.remote_pairs))
예제 #3
0
 def test_print_only_local_pairs(self, mock_print):
     pairs = Pairs(data_dir=data_dir, local=True)
     pairs.print_pairs()
     mock_print.assert_called_with('\n'.join(pairs.local_pairs))
예제 #4
0
 def test_jap2cos_pair_isnt_avalaible_remotly(self):
     pairs = Pairs(data_dir=data_dir, local=True)
     self.assertNotIn('jap-cos', pairs.local_pairs)
예제 #5
0
 def test_por2fra_pair_isnt_avalaible_locally(self):
     pairs = Pairs(data_dir=mkdtemp(), local=True)
     self.assertNotIn('por-fra', pairs.local_pairs)
예제 #6
0
 def test_por2fra_pair_is_avalaible_remotly(self):
     pairs = Pairs(data_dir=data_dir, local=True)
     self.assertIn('por-fra', pairs.remote_pairs)