mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-07-28 04:07:46 +00:00
jedi: Add tests for methods on hub.ble.
This commit is contained in:
committed by
Laurens Valk
parent
7014f46441
commit
7900f03574
@@ -5,7 +5,6 @@
|
||||
Tests for correct code completion of the CityHub class.
|
||||
"""
|
||||
|
||||
|
||||
import json
|
||||
from pybricks_jedi import CompletionItem, complete
|
||||
|
||||
@@ -82,3 +81,15 @@ def test_hub_dot_system_dot():
|
||||
"shutdown",
|
||||
"storage",
|
||||
]
|
||||
|
||||
|
||||
def test_hub_dot_ble_dot():
|
||||
line = "hub.ble."
|
||||
code = _create_snippet(line)
|
||||
completions: list[CompletionItem] = json.loads(complete(code, 3, len(line) + 1))
|
||||
assert [c["insertText"] for c in completions] == [
|
||||
"broadcast",
|
||||
"observe",
|
||||
"signal_strength",
|
||||
"version",
|
||||
]
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
Tests for correct code completion of the EssentialHub class.
|
||||
"""
|
||||
|
||||
|
||||
import json
|
||||
from pybricks_jedi import CompletionItem, complete
|
||||
|
||||
@@ -114,3 +113,15 @@ def test_hub_dot_system_dot():
|
||||
"shutdown",
|
||||
"storage",
|
||||
]
|
||||
|
||||
|
||||
def test_hub_dot_ble_dot():
|
||||
line = "hub.ble."
|
||||
code = _create_snippet(line)
|
||||
completions: list[CompletionItem] = json.loads(complete(code, 3, len(line) + 1))
|
||||
assert [c["insertText"] for c in completions] == [
|
||||
"broadcast",
|
||||
"observe",
|
||||
"signal_strength",
|
||||
"version",
|
||||
]
|
||||
|
||||
@@ -39,4 +39,5 @@ from test_complete_prime_hub import ( # noqa F401
|
||||
test_hub_dot_light_dot,
|
||||
test_hub_dot_speaker_dot,
|
||||
test_hub_dot_system_dot,
|
||||
test_hub_dot_ble_dot,
|
||||
)
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
Tests for correct code completion of the MoveHub class.
|
||||
"""
|
||||
|
||||
|
||||
import json
|
||||
from pybricks_jedi import CompletionItem, complete
|
||||
|
||||
@@ -94,3 +93,15 @@ def test_hub_dot_system_dot():
|
||||
"shutdown",
|
||||
"storage",
|
||||
]
|
||||
|
||||
|
||||
def test_hub_dot_ble_dot():
|
||||
line = "hub.ble."
|
||||
code = _create_snippet(line)
|
||||
completions: list[CompletionItem] = json.loads(complete(code, 3, len(line) + 1))
|
||||
assert [c["insertText"] for c in completions] == [
|
||||
"broadcast",
|
||||
"observe",
|
||||
"signal_strength",
|
||||
"version",
|
||||
]
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
Tests for correct code completion of the PrimeHub class.
|
||||
"""
|
||||
|
||||
|
||||
import json
|
||||
from pybricks_jedi import CompletionItem, complete
|
||||
|
||||
@@ -143,3 +142,15 @@ def test_hub_dot_system_dot():
|
||||
"shutdown",
|
||||
"storage",
|
||||
]
|
||||
|
||||
|
||||
def test_hub_dot_ble_dot():
|
||||
line = "hub.ble."
|
||||
code = _create_snippet(line)
|
||||
completions: list[CompletionItem] = json.loads(complete(code, 3, len(line) + 1))
|
||||
assert [c["insertText"] for c in completions] == [
|
||||
"broadcast",
|
||||
"observe",
|
||||
"signal_strength",
|
||||
"version",
|
||||
]
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
Tests for correct code completion of the TechnicHub class.
|
||||
"""
|
||||
|
||||
|
||||
import json
|
||||
from pybricks_jedi import CompletionItem, complete
|
||||
|
||||
@@ -102,3 +101,15 @@ def test_hub_dot_system_dot():
|
||||
"shutdown",
|
||||
"storage",
|
||||
]
|
||||
|
||||
|
||||
def test_hub_dot_ble_dot():
|
||||
line = "hub.ble."
|
||||
code = _create_snippet(line)
|
||||
completions: list[CompletionItem] = json.loads(complete(code, 3, len(line) + 1))
|
||||
assert [c["insertText"] for c in completions] == [
|
||||
"broadcast",
|
||||
"observe",
|
||||
"signal_strength",
|
||||
"version",
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user