Skip to content

Commit 9ebd3e2

Browse files
julianstirlingrwb27
authored andcommitted
Include the "description" of the Thing in the thing_description
1 parent 99aa380 commit 9ebd3e2

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/labthings_fastapi/thing.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ def thing_description(
377377

378378
td = ThingDescription(
379379
title=getattr(self, "title", self.__class__.__name__),
380+
description=self.__doc__,
380381
properties=properties,
381382
actions=actions,
382383
security="no_security",

tests/test_server.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ def test_server_thing_descriptions():
5454

5555
for thing_name in thing_names:
5656
thing_description = thing_descriptions[thing_name]
57+
58+
expected_description = "An example Thing with a few affordances."
59+
assert thing_description["description"] == expected_description
60+
5761
for action_name in actions:
5862
action = thing_description["actions"][action_name]
5963
expected_href = thing_name + "/" + action_name

0 commit comments

Comments
 (0)