Fix #6669. bSDD now supports test dictionaries, refactor domain to dictionary, support zero length keyword searches, multi-dict support, and basic tests.

Feature tests can now have more sophisticated per UIList item spies.
This commit is contained in:
Dion Moult
2025-05-17 21:27:47 +10:00
parent 8e34c1d7df
commit 22f10e5549
14 changed files with 420 additions and 183 deletions
+20 -9
View File
@@ -610,15 +610,15 @@ class Client:
print(f"function 'Client.Unit' is deprecated, use 'Client.get_units' instead")
return self.get(f"api/Unit/{version}")
def get_dictionary(self, dictionary_uri: str = "", version: int = 1) -> DictionaryResponseContractV1:
def get_dictionary(
self, dictionary_uri: str = "", include_test_dictionaries: bool = "False", version: int = 1
) -> DictionaryResponseContractV1:
"""
Get list of available Dictionaries
This API replaces Domain
"""
endpoint = f"Dictionary/v{version}"
params = {
"Uri": dictionary_uri,
}
params = {"Uri": dictionary_uri, "IncludeTestDictionaries": "true" if include_test_dictionaries else "false"}
return self.get(endpoint, params)
def get_classes(
@@ -626,6 +626,8 @@ class Client:
dictionary_uri: str,
use_nested_classes: bool = True,
class_type: ClassTypes = "Class",
search_text: str = "",
related_ifc_entity: str = "",
language_code: str = "",
version: int = 1,
offset=0,
@@ -636,14 +638,23 @@ class Client:
This API replaces Domain
"""
endpoint = f"Dictionary/v{version}/Classes"
params = {
"Uri": dictionary_uri,
params = {"Uri": dictionary_uri}
for param, value in {
"UseNestedClasses": use_nested_classes,
"ClassType": class_type,
"languageCode": language_code,
"offset": offset,
"limit": limit,
}
}.items():
if value:
params[param] = value
if not use_nested_classes:
for param, value in {
"SearchText": search_text,
"RelatedIfcEntity": related_ifc_entity,
}.items():
if value:
params[param] = value
return self.get(endpoint, params)
def get_properties(
@@ -781,8 +792,8 @@ class Client:
this API replaces ClassificationSearch
"""
if len(search_text) < 3:
raise ValueError("Search text must be at least 3 characters long.")
if len(search_text) < 1:
raise ValueError("Search text must be at least 1 characters long.")
if related_ifc_entities is None:
related_ifc_entities = []