<commit_before>import abc

from simphony.testing.utils import create_data_container


class CheckMaterialRelation(object):

    __metaclass__ = abc.ABCMeta

    def setUp(self):
        pass

    @abc.abstractmethod
    def container_factory(self, name):
        """ Create and return a material relations with the default values

        """

    def test_material_relation_name_update(self):
        """ Test that name is set correctly and updated correctly

        """

        relation = self.container_factory('foo_relation')
        self.assertEqual(relation.name, 'foo_relation')


        relation.name = 'foo_relation_2'
        self.assertEqual(relation.name, 'foo_relation_2')

    def test_material_relation_invalid_name_update(self):
        """ Test that name is updated correctly

        """

        relation = self.container_factory('foo_relation')

        with self.assertRaises(TypeError):
            relation.name = 42<commit_msg>Improve factory description<commit_after>import abc

from simphony.testing.utils import create_data_container


class CheckMaterialRelation(object):

    __metaclass__ = abc.ABCMeta

    def setUp(self):
        pass

    @abc.abstractmethod
    def container_factory(self, name):
        """ Create and return a material relations with the default parameters

        """

    def test_material_relation_name_update(self):
        """ Test that name is set correctly and updated correctly

        """

        relation = self.container_factory('foo_relation')
        self.assertEqual(relation.name, 'foo_relation')


        relation.name = 'foo_relation_2'
        self.assertEqual(relation.name, 'foo_relation_2')

    def test_material_relation_invalid_name_update(self):
        """ Test that name is updated correctly

        """

        relation = self.container_factory('foo_relation')

        with self.assertRaises(TypeError):
            relation.name = 42
{'fraction_non_alphanumeric': 0.08203530633437175, 'fraction_numerical': 0.004153686396677051, 'mean_word_length': 3.006237006237006, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '521456', 'n_tokens_mistral': 525, 'n_tokens_neox': 495, 'n_words': 121}