Exemplo n.º 1
0
 def test_cli_process_smoke(self):
     disableLogging()
     with copy_of_directory(
             assets.path_to('kant_aufklaerung_1784/data')) as wsdir:
         with pushd_popd(wsdir):
             with self.assertRaisesRegex(
                     Exception, "Executable not found in PATH: ocrd-foo"):
                 self.invoke_cli(process_cli, ['foo'])
Exemplo n.º 2
0
 def test_getLogger_before_initLogging(self):
     disableLogging()
     self.capture_out_err()
     getLogger('foo')
     out = '\n'.join(self.capture_out_err())
     print(out)
     assert 'getLogger was called before initLogging' in out
     assert __file__ in out
Exemplo n.º 3
0
 def test_multiple_initLogging(self):
     disableLogging()
     initLogging()
     self.capture_out_err()
     initLogging()
     out = '\n'.join(self.capture_out_err())
     assert 'initLogging was called multiple times' in out
     assert __file__ in out
Exemplo n.º 4
0
 def test_mets_get_id_set_id(self):
     with pushd_popd(tempdir=True):
         self.invoke_cli(workspace_cli, ['init'])
         disableLogging()
         mets_id = 'foo123'
         self.invoke_cli(workspace_cli, ['set-id', mets_id])
         disableLogging()
         _, out, _ = self.invoke_cli(workspace_cli, ['get-id'])
         self.assertEqual(out, mets_id + '\n')
Exemplo n.º 5
0
 def setUp(self):
     super().setUp()
     disableLogging()
     self.maxDiff = None
     self.resolver = Resolver()
     self.runner = CliRunner(mix_stderr=False)
Exemplo n.º 6
0
 def _get_log_output(self, *args):
     disableLogging()
     code, out, err = self.invoke_cli(mock_ocrd_cli, args)
     print(code, out, err)
     return out + err
Exemplo n.º 7
0
 def setUp(self):
     super().setUp()
     disableLogging()
Exemplo n.º 8
0
 def setUp(self):
     disableLogging()
     initLogging()
     self.resolver = Resolver()
     self.workspace = self.resolver.workspace_from_url(
         assets.url_of('SBB0000F29300010000/data/mets.xml'))
Exemplo n.º 9
0
 def setUp(self):
     disableLogging()
     initLogging()
Exemplo n.º 10
0
 def setUp(self):
     chdir(dirname(realpath(__file__)) + '/..')
     disableLogging()
     initLogging()