Run some tests.

This commit is contained in:
James Pace 2025-12-21 10:18:35 -05:00
parent 48eb1a1cbe
commit c263886829
2 changed files with 26 additions and 0 deletions

View File

@ -26,6 +26,12 @@ def main(args=None):
if action == 'ping':
asyncio.run(call_ping(options))
if action == 'uptime':
asyncio.run(call_uptime())
if action == 'build_info':
asyncio.run(call_build_info())
if action == 'env':
asyncio.run(call_env())
async def call_ping(options):
if len(options) != 1 or options[0] == "":
@ -39,4 +45,23 @@ async def call_ping(options):
async with session.get('http://localhost:8080/ping', json=request) as resp:
print(await resp.text())
async def call_uptime():
print("Calling uptime.")
async with aiohttp.ClientSession() as session:
async with session.get('http://localhost:8080/uptime') as resp:
print(await resp.text())
async def call_build_info():
print("Calling build_info.")
async with aiohttp.ClientSession() as session:
async with session.get('http://localhost:8080/build_info') as resp:
print(await resp.text())
async def call_env():
print("Calling env.")
async with aiohttp.ClientSession() as session:
async with session.get('http://localhost:8080/env') as resp:
print(await resp.text())

View File

@ -14,6 +14,7 @@ from ament_index_python import get_package_share_directory
import yaml
import ipaddress
import subprocess
import os
def main():
facts = Facts()