diff --git a/ankisyncd.sh b/ankisyncd.sh deleted file mode 100755 index 3b919dc..0000000 --- a/ankisyncd.sh +++ /dev/null @@ -1,5 +0,0 @@ -#! /usr/bin/env bash - -export PYTHONPATH="/usr/share/ankisyncd" - -python /usr/share/ankisyncd/ankisyncd/sync_app.py diff --git a/ankisyncd/users.py b/ankisyncd/users.py index 0f07509..830f978 100644 --- a/ankisyncd/users.py +++ b/ankisyncd/users.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- - - import binascii import hashlib import logging diff --git a/tests/collection_test_base.py b/tests/collection_test_base.py index 26a8f29..fe3b869 100644 --- a/tests/collection_test_base.py +++ b/tests/collection_test_base.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- - import unittest import tempfile import os diff --git a/tests/helpers/collection_utils.py b/tests/helpers/collection_utils.py index 3eb3483..54789b9 100644 --- a/tests/helpers/collection_utils.py +++ b/tests/helpers/collection_utils.py @@ -1,11 +1,8 @@ # -*- coding: utf-8 -*- - - import os import shutil import tempfile - from anki import Collection from helpers.file_utils import FileUtils diff --git a/tests/helpers/db_utils.py b/tests/helpers/db_utils.py index 24fd650..2b1a278 100644 --- a/tests/helpers/db_utils.py +++ b/tests/helpers/db_utils.py @@ -1,11 +1,8 @@ # -*- coding: utf-8 -*- - - import os import sqlite3 import subprocess - from helpers.file_utils import FileUtils diff --git a/tests/helpers/file_utils.py b/tests/helpers/file_utils.py index 2238b5c..07e877e 100644 --- a/tests/helpers/file_utils.py +++ b/tests/helpers/file_utils.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- - - from cStringIO import StringIO import json import logging @@ -12,9 +10,7 @@ import tempfile import unicodedata import zipfile - from anki.consts import SYNC_ZIP_SIZE -from anki.utils import checksum class FileUtils(object): diff --git a/tests/helpers/mock_servers.py b/tests/helpers/mock_servers.py index 6ac0332..f35361a 100644 --- a/tests/helpers/mock_servers.py +++ b/tests/helpers/mock_servers.py @@ -1,10 +1,7 @@ # -*- coding: utf-8 -*- - - import logging - -from anki.sync import HttpSyncer, RemoteServer, RemoteMediaServer, FullSyncer +from anki.sync import HttpSyncer, RemoteServer, RemoteMediaServer class MockServerConnection(object): diff --git a/tests/helpers/monkey_patches.py b/tests/helpers/monkey_patches.py index f9ea83b..63792b6 100644 --- a/tests/helpers/monkey_patches.py +++ b/tests/helpers/monkey_patches.py @@ -1,12 +1,9 @@ # -*- coding: utf-8 -*- - - import os import sqlite3 as sqlite from anki.media import MediaManager from anki.storage import DB - mediamanager_orig_funcs = { "findChanges": None, "mediaChangesZip": None, @@ -14,7 +11,6 @@ mediamanager_orig_funcs = { "syncDelete": None } - db_orig_funcs = { "__init__": None } diff --git a/tests/helpers/server_utils.py b/tests/helpers/server_utils.py index c245402..5850916 100644 --- a/tests/helpers/server_utils.py +++ b/tests/helpers/server_utils.py @@ -1,12 +1,6 @@ # -*- coding: utf-8 -*- - - -import filecmp import logging -import os import ConfigParser -import shutil - from ankisyncd.sync_app import SyncApp, SyncCollectionHandler, SyncMediaHandler from helpers.file_utils import FileUtils diff --git a/tests/sync_app_functional_test_base.py b/tests/sync_app_functional_test_base.py index ae71afc..c9fa225 100644 --- a/tests/sync_app_functional_test_base.py +++ b/tests/sync_app_functional_test_base.py @@ -1,11 +1,8 @@ # -*- coding: utf-8 -*- - - import os import unittest from webtest import TestApp - from ankisyncd.users import SqliteUserManager from helpers.collection_utils import CollectionUtils from helpers.db_utils import DBUtils diff --git a/tests/test_sync_app.py b/tests/test_sync_app.py index a5fac64..b5a85d5 100644 --- a/tests/test_sync_app.py +++ b/tests/test_sync_app.py @@ -1,25 +1,18 @@ # -*- coding: utf-8 -*- - -import binascii -import hashlib import os import sqlite3 import tempfile import unittest from ankisyncd.sync_app import SyncCollectionHandler -from ankisyncd.sync_app import SimpleUserManager -from ankisyncd.sync_app import SqliteUserManager from ankisyncd.sync_app import SyncUserSession from ankisyncd.sync_app import SimpleSessionManager from ankisyncd.sync_app import SqliteSessionManager -from ankisyncd.sync_app import SyncApp from collection_test_base import CollectionTestBase class SyncCollectionHandlerTest(CollectionTestBase): - def setUp(self): CollectionTestBase.setUp(self) self.syncCollectionHandler = SyncCollectionHandler(self.collection) @@ -122,7 +115,3 @@ class SqliteSessionManagerTest(SimpleSessionManagerTest): class SyncAppTest(unittest.TestCase): pass - - -if __name__ == '__main__': - unittest.main() diff --git a/tests/test_users.py b/tests/test_users.py index 59fdfbe..b102713 100644 --- a/tests/test_users.py +++ b/tests/test_users.py @@ -1,10 +1,7 @@ # -*- coding: utf-8 -*- - - import os import unittest - from ankisyncd.users import SimpleUserManager, SqliteUserManager from helpers.file_utils import FileUtils diff --git a/tests/test_web_media.py b/tests/test_web_media.py index 7cce65c..56db276 100644 --- a/tests/test_web_media.py +++ b/tests/test_web_media.py @@ -1,18 +1,14 @@ # -*- coding: utf-8 -*- - - import filecmp import os - -from anki.sync import Syncer, MediaSyncer +from anki.sync import MediaSyncer from helpers.mock_servers import MockRemoteMediaServer from helpers.monkey_patches import monkeypatch_mediamanager, unpatch_mediamanager from sync_app_functional_test_base import SyncAppFunctionalTestBase class SyncAppFunctionalMediaTest(SyncAppFunctionalTestBase): - def setUp(self): SyncAppFunctionalTestBase.setUp(self)