mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 11:09:23 +01:00
Guard against non-existent spell/fortune/wtf commands.
This commit is contained in:
parent
7cf27435bb
commit
d5ed1e772c
@ -32,21 +32,24 @@
|
|||||||
from testsupport import *
|
from testsupport import *
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import utils
|
||||||
|
|
||||||
if os.name == 'posix':
|
if os.name == 'posix':
|
||||||
class UnixTestCase(PluginTestCase, PluginDocumentation):
|
class UnixTestCase(PluginTestCase, PluginDocumentation):
|
||||||
plugins = ('Unix',)
|
plugins = ('Unix',)
|
||||||
def testSpell(self):
|
if utils.findBinaryInPath('aspell') is not None or \
|
||||||
self.assertRegexp('spell Strike', 'correctly')
|
utils.findBinaryInPath('ispell') is not None:
|
||||||
self.assertRegexp('spell asdlkjsdalfkjasdflkasjdflskdfjlsd',
|
def testSpell(self):
|
||||||
'not find')
|
self.assertRegexp('spell Strike', 'correctly')
|
||||||
self.assertNotError('spell Strizzike')
|
self.assertRegexp('spell asdlkjsdalfkjasdflkasjdflskdfjlsd',
|
||||||
self.assertError('spell foo bar baz')
|
'not find')
|
||||||
self.assertError('spell -')
|
self.assertNotError('spell Strizzike')
|
||||||
self.assertError('spell .')
|
self.assertError('spell foo bar baz')
|
||||||
self.assertError('spell ?')
|
self.assertError('spell -')
|
||||||
self.assertNotError('spell whereever')
|
self.assertError('spell .')
|
||||||
self.assertNotRegexp('spell foo', 'whatever')
|
self.assertError('spell ?')
|
||||||
|
self.assertNotError('spell whereever')
|
||||||
|
self.assertNotRegexp('spell foo', 'whatever')
|
||||||
|
|
||||||
def testErrno(self):
|
def testErrno(self):
|
||||||
self.assertRegexp('errno 12', '^ENOMEM')
|
self.assertRegexp('errno 12', '^ENOMEM')
|
||||||
@ -58,8 +61,9 @@ if os.name == 'posix':
|
|||||||
def testCrypt(self):
|
def testCrypt(self):
|
||||||
self.assertNotError('crypt jemfinch')
|
self.assertNotError('crypt jemfinch')
|
||||||
|
|
||||||
def testFortune(self):
|
if utils.findBinaryInPath('fortune') is not None:
|
||||||
self.assertNotError('fortune')
|
def testFortune(self):
|
||||||
|
self.assertNotError('fortune')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user