Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SaneDev implementation #16

Merged
merged 2 commits into from
Nov 4, 2024

Conversation

Jupi007
Copy link
Collaborator

@Jupi007 Jupi007 commented Nov 4, 2024

This implementation allows us to test the library API without a real scanner connected.
The isolated implementation can switch between real and fake:

-final sane = SaneIsolate(sane: Sane());
+final sane = SaneIsolate(sane: SaneDev());

Every method is delayed by 1 second, except init() and exit().

Fixes #15

@Jupi007 Jupi007 requested a review from Craftplacer November 4, 2024 07:42
@Jupi007 Jupi007 marked this pull request as ready for review November 4, 2024 07:42
@Jupi007
Copy link
Collaborator Author

Jupi007 commented Nov 4, 2024

I plan to improve this SaneDev class by adding multiple devices each one having a different behavior (like throw fake error at some step), this way we can easily test and develop the frontend app.

Copy link
Collaborator

@Craftplacer Craftplacer left a comment

Choose a reason for hiding this comment

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

Looks alright, albeit with many delays.

@Jupi007
Copy link
Collaborator Author

Jupi007 commented Nov 4, 2024

I need to bench the real sane implementation to how long it takes, and adapt the delay.
But for now 1s is okay.

@Jupi007 Jupi007 merged commit 98643a9 into ubuntu-flutter-community:main Nov 4, 2024
2 checks passed
@Jupi007 Jupi007 deleted the Jupi007/issue15 branch November 4, 2024 08:09
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.

Add SaneDev implementation
2 participants