mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-04-24 13:05:50 +00:00
more testing
This commit is contained in:
parent
cad162bb8f
commit
0e0ebf6687
@ -20,6 +20,9 @@ from testtools import (
|
||||
skipIf,
|
||||
)
|
||||
|
||||
from hypothesis.strategies import text
|
||||
from hypothesis import given
|
||||
|
||||
from testtools.matchers import (
|
||||
Contains,
|
||||
Equals,
|
||||
@ -44,6 +47,10 @@ from ...scripts.tahoe_run import (
|
||||
RunOptions,
|
||||
run,
|
||||
)
|
||||
from ...util.pid import (
|
||||
check_pid_process,
|
||||
InvalidPidFile,
|
||||
)
|
||||
|
||||
from ...scripts.runner import (
|
||||
parse_options
|
||||
@ -180,7 +187,18 @@ class RunTests(SyncTestCase):
|
||||
config.stderr.getvalue(),
|
||||
Contains("found invalid PID file in"),
|
||||
)
|
||||
# because the pidfile is invalid we shouldn't get to the
|
||||
# .run() call itself.
|
||||
self.assertThat(
|
||||
DummyRunner.runs,
|
||||
Equals([])
|
||||
)
|
||||
|
||||
@given(text())
|
||||
def test_pidfile_contents(self, content):
|
||||
pidfile = FilePath("pidfile")
|
||||
pidfile.setContent(content.encode("utf8"))
|
||||
|
||||
with self.assertRaises(InvalidPidFile):
|
||||
with check_pid_process(pidfile):
|
||||
pass
|
||||
|
Loading…
x
Reference in New Issue
Block a user