Christoph Mack and flan
c805468449
Refactor ankiserverctl.py to delegate database operations to SqliteUserManager and use python3 compatible print calls.
2017-10-28 23:13:46 +02:00
Christoph Mack and flan
c7d7ff3e85
Merge SyncApp's SqliteUserManager and the newly introduced UserManager and group all user managers in user_managers.py.
2017-10-28 22:45:27 +02:00
Christoph Mack and flan
573aeece81
Add more test helpers and integration tests for SyncApp's media sync 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.
2017-10-28 22:36:48 +02:00
Christoph Mack and flan
cb574aa0a7
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.
2017-10-28 21:55:19 +02:00
Christoph Mack and flan
28e950c138
Added unit tests for SimpleUserManager, SqliteUserManagerTest, SimpleSessionManager and SqliteSessionManagerTest.
2017-10-28 21:20:47 +02:00
Christoph Mack and flan
6e881bfb85
Added unit test for SyncCollectionHandler. Moved CollectionTestBase to a separate file.
2017-10-28 21:19:50 +02:00
Christoph Mack and flan
2cb5871ba3
Safer handling of uploaded database files during full sync.
...
Before overwriting its version of a user's collection database file with one uploaded by the client, the server now performs a basic integrity check using SQLite's 'pragma integrity_check'.
2017-10-28 20:02:59 +02:00
Christoph Mack and flan
f3788fc2c8
fix syntax error causing failure in error handler in SyncMediaHandler._remove_media_files()
2017-10-28 19:58:34 +02:00
Christoph Mack and jdoe0
e32bceccf3
Not only add, but also remove files when adopting changes to client media files in SyncMediaHandler.uploadChanges().
...
Count added and removed files as processed and increment media usn accodingly.
Refactor SyncMediaHandler.uploadChanges().
2016-04-05 23:24:12 +07:00
Christoph Mack and jdoe0
87ee726d25
Define skey once when creating user session, not each time when beginning media sync.
2016-04-05 23:24:00 +07:00
Christoph Mack and jdoe0
1b1a3d8e22
Define a random skey to return to the client when media syncing begins, so we don't send a null skey value.
2016-04-05 23:21:05 +07:00
Christoph Mack and jdoe0
f03aea67c1
SyncMediaHandler.begin(): return media database usn instead of collection database usn.
...
If the wrong usn is returned, media syncing on the client will not finish with status "noChanges" even if there have been no changes since the last media sync.
2016-01-24 01:54:35 +07:00