Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
cwasicki committed Dec 19, 2023
1 parent ccc89d1 commit e75464d
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
13 changes: 13 additions & 0 deletions wc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
SSH tunnel tested
```
ssh -N -L 50051:fz-0003.frequenz.io:50051 fz-0003.frequenz.io
ssh -N -L 50051:localhost:50051 fz-0003.frequenz.io
ssh -N -L 50051:0.0.0.0:50051 fz-0003.frequenz.io
```

SSH diagnostics
```
netstat -tuln | grep 50051
telnet localhost 50051
nc -vz localhost 50051
```
3 changes: 3 additions & 0 deletions wc/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#git+https://github.com/noah-kreutzer-frequenz/frequenz-api-weather@client_noah
#git+https://github.com/cwasicki/frequenz-api-weather@client_wc
git+https://github.com/cwasicki/frequenz-api-weather@noah
37 changes: 37 additions & 0 deletions wc/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import asyncio
from frequenz.client.weather._client import Client
from frequenz.client.weather._types import ForecastFeature, Location
import grpc.aio as grpcaio



async def main():
target="localhost:50051"

client = Client(
grpcaio.insecure_channel(target), # or secure channel with credentials
target,
)

features = [
ForecastFeature.V_WIND_COMPONENT_100_METRE,
ForecastFeature.U_WIND_COMPONENT_100_METRE,
]

locations = [
Location(
latitude=52.5,
longitude=13.4,
country_code="DE",
),
]

stream = await client.stream_live_forecast(
features=features,
locations=locations,
)

async for fc in stream:
print(fc)

asyncio.run(main())

0 comments on commit e75464d

Please sign in to comment.