• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2021-2022 Google LLC
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      https://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15# -----------------------------------------------------------------------------
16# Imports
17# -----------------------------------------------------------------------------
18
19
20# -----------------------------------------------------------------------------
21def test_import():
22    from bumble import (
23        att,
24        bridge,
25        company_ids,
26        controller,
27        core,
28        crypto,
29        device,
30        gap,
31        hci,
32        hfp,
33        host,
34        keys,
35        l2cap,
36        link,
37        rfcomm,
38        sdp,
39        smp,
40        transport,
41        utils,
42    )
43
44    assert att
45    assert bridge
46    assert company_ids
47    assert controller
48    assert core
49    assert crypto
50    assert device
51    assert gap
52    assert hci
53    assert hfp
54    assert host
55    assert keys
56    assert l2cap
57    assert link
58    assert rfcomm
59    assert sdp
60    assert smp
61    assert transport
62    assert utils
63
64
65# -----------------------------------------------------------------------------
66def test_app_imports():
67    from apps.console import main
68
69    assert main
70
71    from apps.controller_info import main
72
73    assert main
74
75    from apps.controllers import main
76
77    assert main
78
79    from apps.gatt_dump import main
80
81    assert main
82
83    from apps.gg_bridge import main
84
85    assert main
86
87    from apps.hci_bridge import main
88
89    assert main
90
91    from apps.pair import main
92
93    assert main
94
95    from apps.scan import main
96
97    assert main
98
99    from apps.show import main
100
101    assert main
102
103    from apps.unbond import main
104
105    assert main
106
107    from apps.usb_probe import main
108
109    assert main
110
111
112# -----------------------------------------------------------------------------
113def test_profiles_imports():
114    from bumble.profiles import (
115        battery_service,
116        device_information_service,
117        heart_rate_service,
118    )
119
120    assert battery_service
121    assert device_information_service
122    assert heart_rate_service
123
124
125# -----------------------------------------------------------------------------
126if __name__ == '__main__':
127    test_import()
128    test_app_imports()
129    test_profiles_imports()
130