Exemplo n.º 1
0
    def test_get_endpoints(self, mocker, mock_response_new):
        endpoints = [
            'authtoken',
            'ping',
            'config',
            #'settings',
            'me',
            'dashboard',
            'organizations',
            'users',
            'projects',
            'teams',
            'credentials',
            'inventory',
            'inventory_scripts',
            'inventory_sources',
            'groups',
            'hosts',
            'job_templates',
            'jobs',
            'ad_hoc_commands',
            'system_job_templates',
            'system_jobs',
            'schedules',
            'notification_templates',
            'notifications',
            'labels',
            'unified_job_templates',
            'unified_jobs',
            'activity_stream',
            'workflow_job_templates',
            'workflow_jobs',
        ]
        view = ApiVersionRootView()
        ret = view.get(mocker.MagicMock())

        assert ret == mock_response_new
        data_arg = mock_response_new.mock_calls[0][1][1]
        for endpoint in endpoints:
            assert endpoint in data_arg
Exemplo n.º 2
0
 def test_get_endpoints(self, mocker):
     endpoints = [
         'ping',
         'config',
         #'settings',
         'me',
         'dashboard',
         'organizations',
         'users',
         'projects',
         'teams',
         'credentials',
         'inventory',
         'inventory_scripts',
         'inventory_sources',
         'groups',
         'hosts',
         'job_templates',
         'jobs',
         'ad_hoc_commands',
         'system_job_templates',
         'system_jobs',
         'schedules',
         'notification_templates',
         'notifications',
         'labels',
         'unified_job_templates',
         'unified_jobs',
         'activity_stream',
         'workflow_job_templates',
         'workflow_jobs',
     ]
     view = ApiVersionRootView()
     ret = view.get(mocker.MagicMock())
     assert ret.status_code == 200
     for endpoint in endpoints:
         assert endpoint in ret.data