Skip to content

Commit a0eb68f

Browse files
convert back to setuptools for ease of use and interop reason, update some test cases
1 parent ccdc0b0 commit a0eb68f

File tree

4 files changed

+39
-13
lines changed

4 files changed

+39
-13
lines changed

pyproject.toml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
[build-system]
2-
requires = ["poetry-core"]
3-
build-backend = "poetry.core.masonry.api"
2+
requires = ["setuptools>=61.0"]
3+
build-backend = "setuptools.build_meta"
44

5-
[tool.poetry]
5+
[project]
66
name = "conSys4Py"
7-
version = "0.0.1-alpha.1"
8-
authors = ["Ian Patterson <ian@botts-inc.com>"]
7+
version = "0.0.1-alpha.3"
8+
authors = [
9+
{ name = "Ian Patterson", email = "ian@botts-inc.com" }
10+
]
911
description = "OGC Connected Systems API client for Python"
1012
readme = "README.md"
13+
requires-python = ">=3.10"
1114
classifiers = [
1215
"Programming Language :: Python :: 3.10",
1316
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
1417
"Operating System :: OS Independent"
1518
]
1619

17-
[tool.poetry.dependencies]
18-
python = "^3.10"
19-
pydantic = "^2.6.3"
20-
requests = "^2.31.0"
21-
paho-mqtt = "^2.0.0"
22-
20+
dependencies = [
21+
"pydantic",
22+
"requests",
23+
"paho-mqtt"
24+
]
2325

2426
[project.urls]
2527
"Homepage" = "https://opensensorhub.org"

requirements.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
annotated-types==0.6.0
2+
certifi==2024.2.2
3+
charset-normalizer==3.3.2
4+
idna==3.6
5+
paho-mqtt==2.0.0
6+
pydantic==2.6.4
7+
pydantic_core==2.16.3
8+
requests==2.31.0
9+
typing_extensions==4.10.0
10+
urllib3==2.2.1

tests/test_params.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from conSys4Py.con_sys_api import ConnectedSystemsRequestBuilder
2+
3+
4+
def test_get_params():
5+
builder = ConnectedSystemsRequestBuilder()
6+
api_request = (builder.with_server_url('http://localhost:8282/sensorhub')
7+
.with_api_root('api')
8+
.for_resource_type('systems')
9+
.with_params({'id': [YOUR_UID_HERE]})
10+
.build_url_from_base()
11+
.with_request_method('GET')
12+
.build())
13+
api_request.params = {'id': [YOUR_UID_HERE]}
14+
api_request.make_request()

tests/test_script_full_suite.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,10 +282,10 @@ def test_create_datastreams():
282282
fields=[time_schema, bool_schema]))
283283

284284
print(f'Datastream Schema: {datarecord_schema.model_dump_json(exclude_none=True, by_alias=True)}')
285-
datastream_body = DatastreamBodyJSON(name="Test Datastream", output_name="Test Output #1", schema=datarecord_schema)
285+
datastream_body = DatastreamBodyJSON(name="Test Datastream", output_name="Test Output #1", datastream_schema=datarecord_schema)
286286
temp_test_json = datastream_body.model_dump_json(exclude_none=True, by_alias=True)
287287
print(f'Test Datastream JSON: {temp_test_json}')
288-
resp = Datastreams.add_datastreams_to_system(server_url, retrieved_systems[0]['id'],
288+
resp = Datastreams.add_datastreams_to_system(server_url, retrieved_systems[1]['id'],
289289
datastream_body.model_dump_json(exclude_none=True, by_alias=True),
290290
headers=json_headers)
291291
print(resp)

0 commit comments

Comments
 (0)