def get_formatter_for_type(self, type_id): """ Hook to get a the formatter for a given type :param type_id: the type id for which we need to get the formatter :type type_id: str """ return units_display.get_formatter_for_type(type_id)
def test_get_formatter_for_type(self, mock_drpm, mock_package, mock_id_only): self.assertTrue(mock_package is units_display.get_formatter_for_type(TYPE_ID_RPM)) self.assertTrue(mock_package is units_display.get_formatter_for_type(TYPE_ID_SRPM)) self.assertTrue(mock_drpm is units_display.get_formatter_for_type(TYPE_ID_DRPM)) self.assertTrue(mock_id_only is units_display.get_formatter_for_type(TYPE_ID_ERRATA)) self.assertTrue(mock_id_only is units_display.get_formatter_for_type(TYPE_ID_DISTRO)) self.assertTrue(mock_id_only is units_display.get_formatter_for_type(TYPE_ID_PKG_GROUP)) self.assertTrue(mock_id_only is units_display.get_formatter_for_type(TYPE_ID_PKG_CATEGORY))