From 0da50a6496ebc99df09ef4ad567efa17a5e912d3 Mon Sep 17 00:00:00 2001 From: James Vega Date: Tue, 21 Oct 2003 01:55:13 +0000 Subject: [PATCH] Added some actual Debian tests --- test/test_Debian.py | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/test/test_Debian.py b/test/test_Debian.py index f12a8aaf9..7d5f5f576 100644 --- a/test/test_Debian.py +++ b/test/test_Debian.py @@ -29,11 +29,51 @@ # POSSIBILITY OF SUCH DAMAGE. ### +import os +import time + from test import * class DebianTestCase(PluginTestCase, PluginDocumentation): plugins = ('Debian',) + timeout = 100 + cleanDataDir = False + fileDownloaded = False + def setUp(self, nick='test'): + PluginTestCase.setUp(self) + try: + if os.path.exists(os.path.join(conf.dataDir, 'Contents-i386.gz')): + pass + else: + print + print "Dowloading files, this may take awhile" + while not os.path.exists(os.path.join(conf.dataDir, + 'Contents-i386.gz')): + time.sleep(1) + print "Download complete" + print "Starting test ..." + self.fileDownloaded = True + except KeyboardInterrupt: + pass + + def testDebversion(self): + self.assertNotError('debversion') + self.assertRegexp('debversion lakjdfad', r'^No package.*\(all\)') + self.assertRegexp('debversion unstable alkdjfad', + r'^No package.*\(unstable\)') + self.assertRegexp('debversion gaim', + r'Total matches:.*gaim.*\(stable\)') + self.assertError('debversion unstable') + + def testDebfile(self): + if not self.fileDownloaded: + pass + self.assertNotError('debfile') + self.assertRegexp('debfile --exact bin/gaim', r'net/gaim') + + def testDebincoming(self): + self.assertNotError('debincoming') # vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78: