-
Notifications
You must be signed in to change notification settings - Fork 95
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 helper classes for integration tests, refactor user managers and ankiserverctl.py #35
base: master
Are you sure you want to change the base?
Conversation
…rking with anki collections and sqlite dbs. Add class for managing users so users can be added programmatically without using ankiserverctl.
This doesn't change any existing code to use these classes. Is that intentional (ie. these are meant to be completely seperate)? Or is that coming as a next step? It's definitely easier to review if they are meant to be completely seperate, because it doesn't change anything, I can just merge it. :-) But if later code is going to be changed to use these classes, I'd prefer to review the addition of the new classes at the same time as the changes to the existing code. Thanks! |
I wrote some integration tests for SyncApp using WebTest that depend on the new test helpers but don't change existing code. I'll hopefully be able to review and commit them in this pull request in about a week. |
…feature using WebTest's TestApp. Add test helpers for creating, inspecting and manipulating instances of SyncApp and RestApp. Add subclasses of Anki's RemoteServer and RemoteMediaServer for communicating with the wrapped SyncApp instance under test. Add helpers for monkey patching Anki's MediaManager and DB for easier testing. Add test assets directory.
Made a second commit a few weeks ago with the integration test code. In the future It might be useful to refactor ankiserverctl to use UserManager to avoid duplicate logic for managing users, but there are no direct changes to existing code right now. |
Thanks! I still think it'd be nice to have the changes to the existing code in the same PR, because it would be easier for me to review. |
…r and group all user managers in user_managers.py.
…erManager and use python3 compatible print calls.
Committed changes to existing code. |
script_dir = os.path.dirname(os.path.realpath(__file__)) | ||
ini_file_path = os.path.join(script_dir, | ||
os.pardir, | ||
"development.ini") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't use development.ini - we should create a test.ini that's checked into the repo and is setup specifically for the tests. development.ini is intended for developers doing manually testing
I've added a Travis CI configuration to the master branch. Please merge from master into your PR, and make any changes necessary to get the tests passing on Travis. Thanks! |
Create test.ini as copy of development.ini.
Thanks! The tests are failing because the 'sqldiff' command is unavailable, but the tests that don't depend on that appear to be working |
To add a test for the new check, #35 would be needed to be merged first.
Add test helper classes for creating and managing temporary files, working with anki collections and sqlite dbs. Add class for managing users so users can be added programmatically without using ankiserverctl.