mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-20 05:28:04 +00:00
Skeleton setting up the test infrastructure.
This commit is contained in:
parent
1819e080a0
commit
51b1e5624a
38
src/allmydata/test/test_istorageserver.py
Normal file
38
src/allmydata/test/test_istorageserver.py
Normal file
@ -0,0 +1,38 @@
|
||||
"""
|
||||
Tests for the ``IStorageServer`` interface.
|
||||
"""
|
||||
|
||||
from twisted.trial import unittest
|
||||
from twisted.internet.defer import inlineCallbacks
|
||||
|
||||
from allmydata.interfaces import IStorageServer
|
||||
from .test_system import SystemTestMixin
|
||||
|
||||
|
||||
class IStorageServerTestsMixin:
|
||||
"""
|
||||
Tests for ``IStorageServer``.
|
||||
|
||||
``self.storage_server`` is expected to provide ``IStorageServer``.
|
||||
"""
|
||||
@inlineCallbacks
|
||||
def test_version(self):
|
||||
yield self.storage_server.get_version()
|
||||
|
||||
|
||||
class FoolscapIStorageServerTests(
|
||||
SystemTestMixin, IStorageServerTestsMixin, unittest.TestCase
|
||||
):
|
||||
"""Run tests on Foolscap version of ``IStorageServer."""
|
||||
|
||||
@inlineCallbacks
|
||||
def setUp(self):
|
||||
self.basedir = "test_istorageserver/{}/{}".format(
|
||||
self.__class__.__name__, self._testMethodName
|
||||
)
|
||||
yield SystemTestMixin.setUp(self)
|
||||
yield self.set_up_nodes(1)
|
||||
self.storage_server = next(
|
||||
iter(self.clients[0].storage_broker.get_known_servers())
|
||||
).get_storage_server()
|
||||
self.assertTrue(IStorageServer.providedBy(self.storage_server))
|
Loading…
Reference in New Issue
Block a user