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()
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))
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))
def test_jap2cos_pair_isnt_avalaible_remotly(self): pairs = Pairs(data_dir=data_dir, local=True) self.assertNotIn('jap-cos', pairs.local_pairs)
def test_por2fra_pair_isnt_avalaible_locally(self): pairs = Pairs(data_dir=mkdtemp(), local=True) self.assertNotIn('por-fra', pairs.local_pairs)
def test_por2fra_pair_is_avalaible_remotly(self): pairs = Pairs(data_dir=data_dir, local=True) self.assertIn('por-fra', pairs.remote_pairs)