import unittest
import cybox.bindings.cybox_common_types_1_0 as common_types_binding
import cybox.bindings.mutex_object_1_3 as mutex_binding
from cybox.objects.mutex_object import Mutex


class MutexTest(unittest.TestCase):
    def setUp(self):
        self.test_dict = {'named': True, 'name': {'value': 'test_name'}}
        self.mutex_obj = Mutex.object_from_dict(self.test_dict)
        self.mutex_dict = Mutex.dict_from_object(self.mutex_obj)

    def test_obj_from_dict(self):
        #Make sure it's an instance of the right class
        self.assertIsInstance(self.mutex_obj, mutex_binding.MutexObjectType)
        #Test the named attribute
        self.assertEqual(self.mutex_obj.get_named(), True)
        #Test the name element
        self.assertIsInstance(self.mutex_obj.get_Name(),
                common_types_binding.StringObjectAttributeType)
        self.assertEqual(self.mutex_obj.get_Name().get_valueOf_(), 'test_name')

    def test_dict_from_obj(self):
        #Make sure it's an instance of the right class
        self.assertIsInstance(self.mutex_dict, dict)
        #Test the dictionary values
        self.assertEqual(self.mutex_dict['named'], True)
        self.assertEqual(self.mutex_dict['name']['value'], 'test_name')

if __name__ == "__main__":
    unittest.main()

@@ -541,35 +541,40 @@
      self.assert
-IsI
+True(isi
 nstance(self.mut
@@ -580,16 +580,51 @@
 tex_obj,
+%0A                                  
  mutex_b
@@ -642,24 +642,25 @@
 xObjectType)
+)
 %0A        #Te
@@ -783,35 +783,40 @@
      self.assert
-IsI
+True(isi
 nstance(self.mut
@@ -850,16 +850,35 @@
         
+      
+             
 common_t
@@ -916,16 +916,17 @@
 uteType)
+)
 %0A       
@@ -1111,11 +1111,16 @@
 sert
-IsI
+True(isi
 nsta
@@ -1141,24 +1141,25 @@
 _dict, dict)
+)
 %0A        #Te

Fix some more unittest assert methods for Python 2.6