<s> import unittest <EOL> import importlib <EOL> import os . path <EOL> from mock import MagicMock <EOL> from jumpgate . common . dispatcher import Dispatcher <EOL> from jumpgate . api import Jumpgate , SUPPORTED_SERVICES <EOL> DIR_PATH = os . path . dirname ( __file__ ) <EOL> MOCK_CONFIG = MagicMock ( ) <EOL> MOCK_CONFIG . softlayer . catalog_template_file = os . path . join ( <EOL> DIR_PATH , '<STR_LIT>' ) <EOL> MOCK_CONFIG . softlayer . catalog_template_file_v3 = os . path . join ( <EOL> DIR_PATH , '<STR_LIT>' ) <EOL> MOCK_CONFIG . flavors . flavor_list = os . path . join ( DIR_PATH , <EOL> '<STR_LIT>' ) <EOL> MOCK_CONFIG . volume . volume_types = os . path . join ( <EOL> DIR_PATH , '<STR_LIT>' ) <EOL> class TestServiceDispatchers ( unittest . TestCase ) : <EOL> def test_all_endpoints ( self ) : <EOL> for service in SUPPORTED_SERVICES : <EOL> app = Jumpgate ( ) <EOL> app . config = MOCK_CONFIG <EOL> disp = Dispatcher ( ) <EOL> dispatcher_module = importlib . import_module ( '<STR_LIT>' + service ) <EOL> dispatcher_module . add_endpoints ( disp ) <EOL> module_name = '<STR_LIT>' % service <EOL> module = importlib . import_module ( module_name ) <EOL> module . setup_routes ( app , disp ) <EOL> self . assertGreater ( len ( disp . _endpoints ) , <NUM_LIT:0> ) </s>
