summaryrefslogtreecommitdiff
path: root/tests/rpc-test.py
blob: bb61345f12533456e86d14dee01b81420c243b79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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" ) )

    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()