-
Notifications
You must be signed in to change notification settings - Fork 572
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Verify interface implementations. Remove TODO from cd35bd4.
- Loading branch information
1 parent
604e61d
commit a16f98a
Showing
2 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import pytest | ||
from twisted.cred.checkers import ICredentialsChecker | ||
from twisted.cred.portal import IRealm | ||
from zope.interface.verify import verifyClass | ||
|
||
from scrapyd.basicauth import PublicHTMLRealm, StringCredentialsChecker | ||
from scrapyd.eggstorage import FilesystemEggStorage | ||
from scrapyd.environ import Environment | ||
from scrapyd.interfaces import IEggStorage, IEnvironment, IJobStorage, IPoller, ISpiderQueue, ISpiderScheduler | ||
from scrapyd.jobstorage import MemoryJobStorage, SqliteJobStorage | ||
from scrapyd.poller import QueuePoller | ||
from scrapyd.scheduler import SpiderScheduler | ||
from scrapyd.spiderqueue import SqliteSpiderQueue | ||
|
||
|
||
@pytest.mark.parametrize('cls,interface', [ | ||
(PublicHTMLRealm, IRealm), | ||
(StringCredentialsChecker, ICredentialsChecker), | ||
(FilesystemEggStorage, IEggStorage), | ||
(Environment, IEnvironment), | ||
(MemoryJobStorage, IJobStorage), | ||
(SqliteJobStorage, IJobStorage), | ||
(QueuePoller, IPoller), | ||
(SpiderScheduler, ISpiderScheduler), | ||
(SqliteSpiderQueue, ISpiderQueue), | ||
]) | ||
def test_interface(cls, interface): | ||
verifyClass(interface, cls) |