Changes to be nice to Windows.

This commit is contained in:
Jeremy Fincher 2003-10-05 20:05:53 +00:00
parent d3a9a46d99
commit 498682d830
3 changed files with 27 additions and 21 deletions

View File

@ -39,7 +39,7 @@ import plugins
import os import os
import imp import imp
import sys import sys
import crypt import math
import random import random
import string import string
@ -53,7 +53,7 @@ import utils
import privmsgs import privmsgs
import callbacks import callbacks
pythonPath = map(os.path.dirname, [os.__file__, crypt.__file__]) pythonPath = map(os.path.dirname, [os.__file__, math.__file__])
def configure(onStart, afterConnect, advanced): def configure(onStart, afterConnect, advanced):
# This will be called by setup.py to configure this module. onStart and # This will be called by setup.py to configure this module. onStart and

View File

@ -31,14 +31,17 @@
from test import * from test import *
import os
class PythonTestCase(PluginTestCase, PluginDocumentation): class PythonTestCase(PluginTestCase, PluginDocumentation):
plugins = ('Python',) plugins = ('Python',)
def testPydoc(self): def testPydoc(self):
self.assertError('pydoc foobar') self.assertError('pydoc foobar')
self.assertError('pydoc assert') self.assertError('pydoc assert')
self.assertNotError('pydoc str') self.assertNotError('pydoc str')
self.assertNotRegexp('pydoc crypt.crypt', 'NameError') if os.name == 'posix':
self.assertNotError('pydoc crypt.crypt') self.assertNotRegexp('pydoc crypt.crypt', 'NameError')
self.assertNotError('pydoc crypt.crypt')
self.assertNotError('pydoc math.sin') self.assertNotError('pydoc math.sin')
self.assertNotError('pydoc string.translate') self.assertNotError('pydoc string.translate')
self.assertNotError('pydoc fnmatch.fnmatch') self.assertNotError('pydoc fnmatch.fnmatch')

View File

@ -31,27 +31,30 @@
from test import * from test import *
class UnixTestCase(PluginTestCase, PluginDocumentation): import os
plugins = ('Unix',)
def testSpell(self):
self.assertRegexp('spell Strike', 'correctly')
self.assertRegexp('spell asdlkfjasdlfkjsdalfkjasdflkasjdflskdfjlsd',
'not find')
self.assertNotError('spell Strizzike')
self.assertError('spell foo bar baz')
def testErrno(self): if os.name == 'posix':
self.assertRegexp('errno 12', '^ENOMEM') class UnixTestCase(PluginTestCase, PluginDocumentation):
self.assertRegexp('errno ENOMEM', '#12') plugins = ('Unix',)
def testSpell(self):
self.assertRegexp('spell Strike', 'correctly')
self.assertRegexp('spell asdlkjsdalfkjasdflkasjdflskdfjlsd',
'not find')
self.assertNotError('spell Strizzike')
self.assertError('spell foo bar baz')
def testProgstats(self): def testErrno(self):
self.assertNotError('progstats') self.assertRegexp('errno 12', '^ENOMEM')
self.assertRegexp('errno ENOMEM', '#12')
def testCrypt(self): def testProgstats(self):
self.assertNotError('crypt jemfinch') self.assertNotError('progstats')
def testFortune(self): def testCrypt(self):
self.assertNotError('fortune') self.assertNotError('crypt jemfinch')
def testFortune(self):
self.assertNotError('fortune')