Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@bertsky
Copy link
Collaborator

@bertsky bertsky commented Jan 10, 2023

In preparation of fixing #930.

Merely adds new specific test that fails for now.

Draft for easier discussion...

@bertsky bertsky requested a review from kba January 10, 2023 15:55
path.mkdir(parents=True)
path = str(path / 'preset.json')
with open(path, 'w') as out:
# it would be nicer to test some existing processor which does take params
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could install the processors in tests.data (temporarily) which output the parameters they were passed. That way, we could test not only the return value but also the output.

handle json/file parsing in ocrd_cli_wrap_processor (by instantiating the processor) instead of option decorator,
adapt tests
@bertsky bertsky marked this pull request as ready for review April 19, 2024 16:34
@bertsky
Copy link
Collaborator Author

bertsky commented Apr 19, 2024

I just tried to merge master into this locally, but git failed in detecting the src/ renames – it marked ocrd/decorators/init.py as conflicting, but did not apply/retain any of my changes.

@kba
Copy link
Member

kba commented Jun 6, 2024

I tried to resolve the conflict, in a separate PR bertsky#6 not to clutter this PR here.

@bertsky
Copy link
Collaborator Author

bertsky commented Jun 6, 2024

wowsa! CI seems to fail miserably...

tests/cli/test_bashlib.py F........                                      [  1%]
...
tests/test_mets_server.py FF..............FFFF                           [ 50%]
...
tests/test_workspace.py ...................................F.....        [ 80%]
...

Maybe it would be better to cherry-pick and start anew?

@bertsky
Copy link
Collaborator Author

bertsky commented Jun 7, 2024

I don't know how, but some of these failed tests (like bashlib processor) must already have been failing earlier. Others might not have surfaced (test_processor had side effects because it did not use an isolated workspace).

Also, I thought it would be cleaner to refactor a little: raising an exception ResourceNotFoundError which can be handled according to taste, and exposing resolve_resource besides show_resource. See #1238.

@bertsky bertsky closed this Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants