From bdb7b6ff6d08067755a79e01eca6435a914a1289 Mon Sep 17 00:00:00 2001 From: akuchling Date: Sat, 19 Mar 2005 16:40:23 +0000 Subject: Add test case --- tests/rpc-test.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 tests/rpc-test.py (limited to 'tests') diff --git a/tests/rpc-test.py b/tests/rpc-test.py new file mode 100755 index 0000000..aea6112 --- /dev/null +++ b/tests/rpc-test.py @@ -0,0 +1,27 @@ +import sys +import config +import store +import unittest +import rpc +import cStringIO + +class XMLRPC ( unittest.TestCase ): + + def setUp( self ): + # get a storage object to use in calls to xmlrpc functions + self.store = store.Store( config.Config( "/tmp/pypi/config.ini", "webui" ) ) + + def testEcho( self ): + result = rpc.echo(self.store, 'a', 'b', 1, 3.4) + self.failUnlessEqual(result, ('a', 'b', 1, 3.4)) + + def testIndex( self ): + result = rpc.index( self.store ) + self.failUnless( len( result ) > 0 ) + + def testSearch( self ): + result = rpc.search( self.store, "sql" ) + self.failUnless( len( result ) > 0 ) + +if __name__ == '__main__': + unittest.main() -- cgit v1.2.1