示例#1
0
    def test_decamelify_custom_delim(self):
        camels = ['thisIsATest', 'ThisIsTest']
        decamels = ['this*is*a*test', 'thisaisatest']
        delims = ['*', 'a']

        for camel, decam, delim in zip(camels, decamels, delims):
            self.assertEqual(decamelify(camel, delim=delim), decam)
示例#2
0
    def class_id(self):
        """Define the id unique to the block class. By default,
        this will be the result of 
        :func:`~dash_building_blocks.util.decamelify`\ ing 
        :attr:`__class__.__name__`, so it is only optionally
        overriden if a custom class id is desired. Similar to :meth:`layout`,
        it becomes an attribute with the same name, :attr:`class_id`.

        :return: The string representing the block class id
        """
        return decamelify(self.__class__.__name__)
示例#3
0
 def block_id(self):
     return decamelify(self.__class__.__name__)
示例#4
0
    def test_decamelify_default_delim(self):
        camels = ['thisIsATest', 'ThisIsATest']
        decamels = ['this-is-a-test', 'this-is-a-test']

        for camel, decam in zip(camels, decamels):
            self.assertEqual(decamelify(camel), decam)