buildframework/helium/sf/python/pythoncore/lib/pythoncoretests/test_ccm_object.py
changeset 628 7c4a911dc066
parent 588 c7c26511138f
--- a/buildframework/helium/sf/python/pythoncore/lib/pythoncoretests/test_ccm_object.py	Wed Jun 16 16:51:40 2010 +0300
+++ b/buildframework/helium/sf/python/pythoncore/lib/pythoncoretests/test_ccm_object.py	Fri Aug 13 14:59:05 2010 +0300
@@ -21,7 +21,7 @@
     unitesting CCMObject functionality
 """
 
-# pylint: disable-msg=R0201
+# pylint: disable=R0201
 
 import unittest
 import ccm
@@ -80,7 +80,9 @@
 
 class MockResultSession(ccm.AbstractSession):
     """ Fake session used to test Result"""
-    def __init__(self, behave = {}, database="fakedb"):
+    def __init__(self, behave=None, database="fakedb"):
+        if behave == None:
+            behave = {}
         ccm.AbstractSession.__init__(self, None, None, None, None)
         self._behave = behave
         self._database = database
@@ -101,6 +103,7 @@
             result.status = -1  
         return result
 
+
 class CCMObjectTest(unittest.TestCase):
     """ Unit test case for CCMObject functionality """
     def test_get_baseline(self):
@@ -115,7 +118,6 @@
         objv2 = session.create('foo-2.0:project:db#1')
         assert objv2.baseline == objv1
 
-
     def test_delete_project(self):
         """ Check project deletion """
         behave = {'delete  -project "project-1:project:db#1"': "Deleting object 'project-1:project:db#1'"}
@@ -140,7 +142,7 @@
         try:
             result = project.delete(recurse=True, scope='project_and_subproject_hierarchy')        
             assert False, "The delete method must fail in case of synergy failure"
-        except:
+        except ccm.CCMException:
             pass
 
     def test_delete_object(self):
@@ -151,5 +153,7 @@
         result = obj.delete()
         assert "Deleting object 'object-1:object:db#1'" in result.output
 
+
+
 if __name__ == "__main__":
     unittest.main()