Exemple #1
0
    def __init__(cls, name, bases, attributes):
        from nautilus.conventions.models import normalize_string

        # create the super class
        super().__init__(name, bases, attributes)

        # the base service strings
        base_strings = [
            normalize_string(name)
            for name in ['service', 'modelService', 'ConnectionService']
        ]

        # if the object does not yet have a name
        if not cls.name or cls.name in base_strings:
            # use the name of the class record
            cls.name = normalize_string(name)
Exemple #2
0
    def __init__(cls, name, bases, attributes):
        from nautilus.conventions.models import normalize_string

        # create the super class
        super().__init__(name, bases, attributes)

        # the base service strings
        base_strings = [normalize_string(name) for name in [
            'service',
            'modelService',
            'ConnectionService'
        ]]

        # if the object does not yet have a name
        if not cls.name or cls.name in base_strings:
            # use the name of the class record
            cls.name = normalize_string(name)
Exemple #3
0
    def test_normalize_string_handles_ClassCase(self):
        string = 'FooBar'

        assert normalize_string(string) == 'fooBar', (
            "ClassCase string could not be normalized"
        )
Exemple #4
0
    def test_normalize_string_handles_ClassCase(self):
        string = 'FooBar'

        assert normalize_string(string) == 'fooBar', (
            "ClassCase string could not be normalized")