def test_get_formatter_for_type(self):
     formatter = units_display.get_formatter_for_type(TYPE_PUPPET_MODULE)
     self.assertEquals(
         'foo-bar-baz',
         formatter({
             'author': 'foo',
             'name': 'bar',
             'version': 'baz'
         }))
Example #2
0
    def get_formatter_for_type(type_id):
        """
        Returns a method that can be used to format the unit key of a puppet_module
        for display purposes

        :param type_id: the type_id of the unit key to get a formatter for
        :type type_id: str
        :return: function
        """
        return units_display.get_formatter_for_type(type_id)
 def test_get_formatter_for_type(self):
     formatter = units_display.get_formatter_for_type(TYPE_PUPPET_MODULE)
     self.assertEquals('foo-bar-baz', formatter({'author': 'foo',
                                                 'name': 'bar',
                                                 'version': 'baz'}))
Example #4
0
 def test_get_formatter_for_type(self):
     formatter = units_display.get_formatter_for_type(TYPE_PUPPET_MODULE)
     self.assertEquals("foo-bar-baz", formatter({"author": "foo", "name": "bar", "version": "baz"}))