MultiTest
Home / Projects / multitest /

Description

MultiTest expands unit-testing in python to highlight possible test errors due to differences in platforms and/or in a particular version of some other dependency.

Types of errors

The types of errors that multitest can highlight, with a number of clients setup, include;

As a simple, contrived, example the following test will fail on most MS-Windows systems but succeed on Linux,

    self.assert_(os.path.exists("/etc"))

Usage

Writing unit-tests

Multitest will run any unit-test module that contains sub-classes of unittest.TestCase.

An example unit-test module;
import unittest

class Tests(unittest.TestCase):
	def testSuccess(self):
		self.assertEqual(1, 1)
	def testFailure(self):
		self.assertEqual(1, 0)
	def testError(self):
		raise Exception()
		self.assertEqual(1, 1)  # Never gets here.

if __name__ == '__main__':
	unittest.main()
Sample unit-tests are available under the multitest/tests sub-folder. These include, Additionally a complete python install includes many tests under the "test" sub-folder. As an example try,
    ./runtest.py test.test_base64

Running the tests

  1. Make sure each client has a copy of your test files.
  2. Run client.py on each computer you wants to run your tests on.
  3. Use runtest.py to specify the clients and the unit-test module to run. For example,
    ./runtest.py --clients localhost,192.168.0.2 multitest.tests.basic
    
  4. View the results.

What client environments to setup

A recommended minimum set of test clients will include,

Download

multitest-0.1.0.tar.bz2 - 9k