From 498682d8300009def7b966ee09fd4d64eccf61a8 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Sun, 5 Oct 2003 20:05:53 +0000 Subject: [PATCH] Changes to be nice to Windows. --- plugins/Python.py | 4 ++-- test/test_Python.py | 7 +++++-- test/test_Unix.py | 37 ++++++++++++++++++++----------------- 3 files changed, 27 insertions(+), 21 deletions(-) diff --git a/plugins/Python.py b/plugins/Python.py index 4b56913fd..6b1fde738 100644 --- a/plugins/Python.py +++ b/plugins/Python.py @@ -39,7 +39,7 @@ import plugins import os import imp import sys -import crypt +import math import random import string @@ -53,7 +53,7 @@ import utils import privmsgs 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): # This will be called by setup.py to configure this module. onStart and diff --git a/test/test_Python.py b/test/test_Python.py index 5ba158481..65d39886b 100644 --- a/test/test_Python.py +++ b/test/test_Python.py @@ -31,14 +31,17 @@ from test import * +import os + class PythonTestCase(PluginTestCase, PluginDocumentation): plugins = ('Python',) def testPydoc(self): self.assertError('pydoc foobar') self.assertError('pydoc assert') self.assertNotError('pydoc str') - self.assertNotRegexp('pydoc crypt.crypt', 'NameError') - self.assertNotError('pydoc crypt.crypt') + if os.name == 'posix': + self.assertNotRegexp('pydoc crypt.crypt', 'NameError') + self.assertNotError('pydoc crypt.crypt') self.assertNotError('pydoc math.sin') self.assertNotError('pydoc string.translate') self.assertNotError('pydoc fnmatch.fnmatch') diff --git a/test/test_Unix.py b/test/test_Unix.py index 967c73cb5..abfe496be 100644 --- a/test/test_Unix.py +++ b/test/test_Unix.py @@ -31,27 +31,30 @@ from test import * -class UnixTestCase(PluginTestCase, PluginDocumentation): - 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') +import os - def testErrno(self): - self.assertRegexp('errno 12', '^ENOMEM') - self.assertRegexp('errno ENOMEM', '#12') +if os.name == 'posix': + class UnixTestCase(PluginTestCase, PluginDocumentation): + 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): - self.assertNotError('progstats') + def testErrno(self): + self.assertRegexp('errno 12', '^ENOMEM') + self.assertRegexp('errno ENOMEM', '#12') - def testCrypt(self): - self.assertNotError('crypt jemfinch') + def testProgstats(self): + self.assertNotError('progstats') - def testFortune(self): - self.assertNotError('fortune') + def testCrypt(self): + self.assertNotError('crypt jemfinch') + + def testFortune(self): + self.assertNotError('fortune')