gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From leosim...@apache.org
Subject svn commit: r152912 - gump/branches/Gump3/pygump/python/gump/test/testModel.py
Date Tue, 08 Feb 2005 18:50:50 GMT
Author: leosimons
Date: Tue Feb  8 10:50:49 2005
New Revision: 152912

URL: http://svn.apache.org/viewcvs?view=rev&rev=152912
Log:
Start testing the model

Added:
    gump/branches/Gump3/pygump/python/gump/test/testModel.py
      - copied, changed from r152907, gump/branches/Gump3/pygump/python/gump/test/testDynagumper.py

Copied: gump/branches/Gump3/pygump/python/gump/test/testModel.py (from r152907, gump/branches/Gump3/pygump/python/gump/test/testDynagumper.py)
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/test/testModel.py?view=diff&rev=152912&p1=gump/branches/Gump3/pygump/python/gump/test/testDynagumper.py&r1=152907&p2=gump/branches/Gump3/pygump/python/gump/test/testModel.py&r2=152912
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/test/testDynagumper.py (original)
+++ gump/branches/Gump3/pygump/python/gump/test/testModel.py Tue Feb  8 10:50:49 2005
@@ -20,37 +20,40 @@
 import unittest
 
 from gump.test.mockobjects import *
-from gump.plugins.dynagumper import Dynagumper
-from gump.model import Project
+from gump.model import Error, Workspace, ModelObject, Repository
 
-mock = MockObjects()
-
-class DynagumperTestCase(unittest.TestCase):
+class ModelTestCase(unittest.TestCase):
     def setUp(self):
-        self.dynagumper = Dynagumper(mock.database,mock.log)
-        self.project = Project("blah", "blah")
-        self.project.startdate = "21 June 2005"
-        self.project.enddate = "22 June 2005"
+        pass
     
-    def testEnsureThisHostIsInDatabase(self):
-        #TODO actual tests
-        self.dynagumper.ensureThisHostIsInDatabase()
-
-    def testVisitWorkSpace(self):
-        #TODO
-        self.dynagumper.visit_workspace("blah")
+    def testError(self):
+        error = Error()
+        try:
+            raise error
+        except:
+            pass
     
-    def testVisitModule(self):
-        #TODO
-        self.dynagumper.visit_module("blah")
+    def testModelObject(self):
+        obj = ModelObject()
     
-    def testVisitProject(self):
-        #TODO
-        self.dynagumper.visit_project(self.project)
+    def testWorkspace(self):
+        w = Workspace("blah")
+        self.assertEquals("blah", w.name)
+        self.assertEquals({}, w.repositories)
+        self.assertEquals({}, w.modules)
+        self.assertEquals({}, w.projects)
+        self.assertEquals([], w.dependencies)
+        
+        r = Repository(w, "blahblah")
+        self.assertEquals({}, w.repositories)
+        w.add_repository(r)
+        self.assertEquals(w.repositories["blahblah"], r)
+        self.assertEquals(1, len(w.repositories))
+
 
 # this is used by testrunner.py to determine what tests to run
 def test_suite():
-    return unittest.makeSuite(DynagumperTestCase,'test')
+    return unittest.makeSuite(ModelTestCase,'test')
 
 # this allows us to run this test by itself from the commandline
 if __name__ == '__main__':



Mime
View raw message