gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From leosim...@apache.org
Subject svn commit: r209496 - in /gump/branches/Gump3/pygump/python/gump/test: testDynagumper.py testModel.py
Date Wed, 06 Jul 2005 18:39:21 GMT
Author: leosimons
Date: Wed Jul  6 11:39:19 2005
New Revision: 209496

URL: http://svn.apache.org/viewcvs?rev=209496&view=rev
Log:
Fix testcases to sync with yesterdays changes

Modified:
    gump/branches/Gump3/pygump/python/gump/test/testDynagumper.py
    gump/branches/Gump3/pygump/python/gump/test/testModel.py

Modified: gump/branches/Gump3/pygump/python/gump/test/testDynagumper.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/test/testDynagumper.py?rev=209496&r1=209495&r2=209496&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/test/testDynagumper.py (original)
+++ gump/branches/Gump3/pygump/python/gump/test/testDynagumper.py Wed Jul  6 11:39:19 2005
@@ -18,9 +18,11 @@
 __license__   = "http://www.apache.org/licenses/LICENSE-2.0"
 
 import unittest
+import time
 from pmock import *
 
 from gump.plugins.dynagumper import Dynagumper
+from gump.plugins.dynagumper import DEFAULT_TIME_FORMAT
 
 from main import _Logger
 
@@ -42,7 +44,7 @@
         db = self.mock()
         db.expects(at_least_once()).method("execute").will(return_value((0,None)))
         dynagumper = Dynagumper(db,self.log)
-        dynagumper.storeHost()
+        dynagumper.add_host_to_db()
 
     def test_visit_workspace(self):
         #TODO
@@ -58,14 +60,25 @@
         self.assertRaises(RuntimeError, dynagumper.visit_workspace, wi)
     
     def test_visit_module(self):
-        #TODO
         class m:
-          def __init__(self, n, d, u):
+          def __init__(self, n, d, u, r):
             self.name = n
             self.description = d
             self.url = u
+            self.repository = r
+        
+        class r:
+          def __init__(self, workspace, name):
+            self.workspace       = workspace
+            self.name            = name
             
-        mi = m("blah", "blah blah", "http://example.com")
+        class w:
+          def __init__(self, name):
+            self.name            = name
+
+        wi = w("blah")
+        ri = r(wi, "blah")
+        mi = m("blah", "blah blah", "http://example.com", ri)
         dynagumper = Dynagumper(self.db,self.log)
         db = self.mock()
         db.expects(once()).method("execute").will(raise_exception(RuntimeError('bla')))
@@ -73,13 +86,35 @@
         self.assertRaises(RuntimeError, dynagumper.visit_module, mi)
     
     def test_visit_project(self):
-        #TODO
+        class m:
+          def __init__(self, n, d, u, r):
+            self.name = n
+            self.description = d
+            self.url = u
+            self.repository = r
+        
+        class r:
+          def __init__(self, workspace, name):
+            self.workspace       = workspace
+            self.name            = name
+            
+        class w:
+          def __init__(self, name):
+            self.name            = name
+            self.run_start = time.strftime(DEFAULT_TIME_FORMAT)
+            self.run_end = self.run_start
+        
+        class p:
+          def __init__(self, module, name):
+            self.module = module
+            self.name = name
+
+        wi = w("blah")
+        ri = r(wi, "blah")
+        mi = m("blah", "blah blah", "http://example.com", ri)
+        pi = p(mi, "blah")
+
         db = self.mock()
         db.expects(once()).method("execute").will(raise_exception(RuntimeError('bla')))
         dynagumper = Dynagumper(db,self.log)
-        self.project = self.mock()
-        self.project.name = "blah"
-        self.project.startdate = "21 June 2005"
-        self.project.enddate = "22 June 2005"
-        
-        self.assertRaises(RuntimeError, dynagumper.visit_project, self.project)
+        self.assertRaises(RuntimeError, dynagumper.visit_project, pi)

Modified: gump/branches/Gump3/pygump/python/gump/test/testModel.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/test/testModel.py?rev=209496&r1=209495&r2=209496&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/test/testModel.py (original)
+++ gump/branches/Gump3/pygump/python/gump/test/testModel.py Wed Jul  6 11:39:19 2005
@@ -38,7 +38,6 @@
 from gump.model import Mkdir
 from gump.model import Rmdir
 from gump.model import Script
-from gump.model import WorkItem
 from gump.model import Jar
 
 class ModelTestCase(TestCase):



Mime
View raw message