MCPcopy Index your code
hub / github.com/dronekit/dronekit-python / test_115

Function test_115

dronekit/test/sitl/test_capability_and_version.py:9–36  ·  view source on GitHub ↗
(connpath)

Source from the content-addressed store, hash-verified

7
8@with_sitl
9def test_115(connpath):
10 v = connect(connpath, wait_ready=True)
11 time.sleep(5)
12 assert_false(v.capabilities.ftp)
13
14 # versions of ArduCopter prior to v3.3 will send out capabilities
15 # flags before they are initialised. Vehicle attempts to refetch
16 # until capabilities are non-zero, but we may need to wait:
17 start_time = time.time()
18 nonzero_capabilities = True
19 slept = False
20 while v.capabilities.mission_float == 0:
21 if time.time() > start_time + 30:
22 nonzero_capabilities = False
23 break
24 time.sleep(0.1)
25 slept = True
26 if v.capabilities.mission_float:
27 if slept:
28 assert_true(v.version.major <= 3)
29 assert_true(v.version_minor <= 3)
30 else:
31 # fail it
32 assert_true(v.capabilities.mission_float)
33
34 assert_true(v.version.major is not None)
35 assert_true(len(v.version.release_type()) >= 2)
36 assert_true(v.version.release_version() is not None)

Callers

nothing calls this directly

Calls 3

connectFunction · 0.90
release_typeMethod · 0.80
release_versionMethod · 0.80

Tested by

no test coverage detected