jedi: Add tests for methods on hub.ble.

This commit is contained in:
Frederik Leonhardt
2026-05-28 11:20:54 +02:00
committed by Laurens Valk
parent 7014f46441
commit 7900f03574
6 changed files with 61 additions and 5 deletions
+12 -1
View File
@@ -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",
]
+12 -1
View File
@@ -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",
]
+1
View File
@@ -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,
)
+12 -1
View File
@@ -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",
]
+12 -1
View File
@@ -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",
]
+12 -1
View File
@@ -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",
]