Commits

mlhamel  committed ef49b1b

fix test and start implementing other test for rpc

  • Participants
  • Parent commits a384524

Comments (0)

Files changed (3)

File buildout.cfg

 [buildout]
 develop = .
-parts = eggs 
+parts = eggs nose
 versions=versions
 newest = false
 extensions = lovely.buildouthttp
      pypi
 
 [nose]
-recipe = pbp.recipe.noserunner
+recipe = pbp.recipe.noserunner
+eggs = ${eggs:eggs}
+working-directory = tests

File tests/rpc-test.py

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

File tests/test_rpc.py

+import sys
+import config
+import store
+import unittest
+import rpc
+import cStringIO
+import store
+import os
+
+CONFIG_FILE = os.path.join(os.path.dirname(store.__file__), "config.ini")
+
+class TestXMLRPC ( unittest.TestCase ):
+
+    def setUp(self):
+        # get a storage object to use in calls to xmlrpc functions
+        self.store = store.Store( config.Config( CONFIG_FILE ) )
+
+    def test_search(self):
+        result = rpc.search( self.store, {}, "sql" )
+        self.failUnless( len( result ) > 0 )
+
+    def test_list_packages(self):
+        result = rpc.list_packages(self.store)
+        self.failUnless(len(result) == len(self.store.get_packages()))
+    
+    def test_package_releases(self):
+        self.failUnless(False)
+
+    def test_release_urls(self):
+        self.failUnless(False)
+
+    def test_release_data(self):
+        self.failUnless(False)
+
+    def test_updated_releases(self):
+        self.failUnless(False)
+
+    def test_changelog(self):
+        self.failUnless(False)
+
+    def test_post_cheesecake_for_release(self):
+        self.failUnless(False)
+
+    def test_ratings(self):
+        self.failUnless(False)
+
+
+if __name__ == '__main__':
+    unittest.main()