Debian Codegraph @

tests/unit/profiles/test_open_stack.py

raw
1 from functools import partial
2
3 from ..utils import isort_test
4
5 open_stack_isort_test = partial(isort_test, profile="open_stack")
6
7
8 def test_open_stack_code_snippet_one() -> None:
9 open_stack_isort_test(
10 """import httplib
11 import logging
12 import random
13 import StringIO
14 import time
15 import unittest
16
17 import eventlet
18 import webob.exc
19
20 import nova.api.ec2
21 from nova.api import manager
22 from nova.api import openstack
23 from nova.auth import users
24 from nova.endpoint import cloud
25 import nova.flags
26 from nova.i18n import _
27 from nova.i18n import _LC
28 from nova import test
29 """,
30 known_first_party=["nova"],
31 py_version="2",
32 order_by_type=False,
33 )
34
35
36 def test_open_stack_code_snippet_two() -> None:
37 open_stack_isort_test(
38 """# Copyright 2011 VMware, Inc
39 # All Rights Reserved.
40 #
41 # Licensed under the Apache License, Version 2.0 (the "License"); you may
42 # not use this file except in compliance with the License. You may obtain
43 # a copy of the License at
44 #
45 # https://www.apache.org/licenses/LICENSE-2.0
46 #
47 # Unless required by applicable law or agreed to in writing, software
48 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
49 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
50 # License for the specific language governing permissions and limitations
51 # under the License.
52
53 import inspect
54 import os
55 import random
56
57 from neutron_lib.callbacks import events
58 from neutron_lib.callbacks import registry
59 from neutron_lib.callbacks import resources
60 from neutron_lib import context
61 from neutron_lib.db import api as session
62 from neutron_lib.plugins import directory
63 from neutron_lib import rpc as n_rpc
64 from oslo_concurrency import processutils
65 from oslo_config import cfg
66 from oslo_log import log as logging
67 from oslo_messaging import server as rpc_server
68 from oslo_service import loopingcall
69 from oslo_service import service as common_service
70 from oslo_utils import excutils
71 from oslo_utils import importutils
72 import psutil
73
74 from neutron.common import config
75 from neutron.common import profiler
76 from neutron.conf import service
77 from neutron import worker as neutron_worker
78 from neutron import wsgi
79
80 service.register_service_opts(service.SERVICE_OPTS)
81 """,
82 known_first_party=["neutron"],
83 )
84
85
86 def test_open_stack_code_snippet_three() -> None:
87 open_stack_isort_test(
88 """
89 # Copyright 2013 Red Hat, Inc.
90 #
91 # Licensed under the Apache License, Version 2.0 (the "License"); you may
92 # not use this file except in compliance with the License. You may obtain
93 # a copy of the License at
94 #
95 # https://www.apache.org/licenses/LICENSE-2.0
96 #
97 # Unless required by applicable law or agreed to in writing, software
98 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
99 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
100 # License for the specific language governing permissions and limitations
101 # under the License.
102
103 import functools
104
105 from oslo_log import log as logging
106 import oslo_messaging as messaging
107 from oslo_messaging.rpc import dispatcher
108 from oslo_serialization import jsonutils
109 from oslo_service import periodic_task
110 from oslo_utils import importutils
111 import six
112
113 import nova.conf
114 import nova.context
115 import nova.exception
116 from nova.i18n import _
117
118 __all__ = [
119 'init',
120 'cleanup',
121 'set_defaults',
122 'add_extra_exmods',
123 'clear_extra_exmods',
124 'get_allowed_exmods',
125 'RequestContextSerializer',
126 'get_client',
127 'get_server',
128 'get_notifier',
129 ]
130
131 profiler = importutils.try_import("osprofiler.profiler")
132 """,
133 known_first_party=["nova"],
134 )