# Path: simphony/api.py



import inspect
import unittest
import warnings
import numpy
import uuid
from collections import Sequence
from simphony.api import CUBA
from simphony.cuds.meta import api as meta_class
        self.assertIsInstance(instance.uid, uuid.UUID)
        self.assertIsNotNone(instance.data)

        # uuid is read-only
        with self.assertRaises(AttributeError):
            instance.uid = uuid.uuid4()

    def check_cuds_component(self, instance):
        ''' Check properties of a CUDS Component '''
        self.assertTrue(hasattr(instance, 'description'),
                        'Should have an attribute called `description`')
        self.assertTrue(hasattr(instance, 'name'),
                        'Should have an attribute called `name`')

        # definition is read-only
        with self.assertRaises(AttributeError):
            instance.definition = 'blah'

        # name should be a string, but it would be casted as such
        instance.name = 1
        self.assertIsInstance(instance.name, str)

        # description should be a string and it would be casted as such
        instance.description = 1
        self.assertIsInstance(instance.description, str)

        # Since NAME and DESCRIPTION are CUBA keys
        # Make sure that their values are stored in
        # the DataContainer as well
        instance.name = 'dummy name'

# Path: simphony/api.py



# Path: simphony/cuds/tests/test_meta_class.py
import inspect
import unittest
import warnings
import numpy
import uuid
from collections import Sequence
from simphony.api import CUBA
from simphony.cuds.meta import api as meta_class

        self.assertIsInstance(instance.uid, uuid.UUID)
        self.assertIsNotNone(instance.data)

        # uuid is read-only
        with self.assertRaises(AttributeError):
            instance.uid = uuid.uuid4()

    def check_cuds_component(self, instance):
        ''' Check properties of a CUDS Component '''
        self.assertTrue(hasattr(instance, 'description'),
                        'Should have an attribute called `description`')
        self.assertTrue(hasattr(instance, 'name'),
                        'Should have an attribute called `name`')

        # definition is read-only
        with self.assertRaises(AttributeError):
            instance.definition = 'blah'

        # name should be a string, but it would be casted as such
        instance.name = 1
        self.assertIsInstance(instance.name, str)

        # description should be a string and it would be casted as such
        instance.description = 1
        self.assertIsInstance(instance.description, str)

        # Since NAME and DESCRIPTION are CUBA keys
        # Make sure that their values are stored in
        # the DataContainer as well
        instance.name = 'dummy name'

        self.assertEqual(instance.data[CUBA.NAME], 'dummy name')