Skip to main content

The most lit ros testing framework

Project description

:fire: pyrostest :fire:
=========

The most :fire: lit :fire: ros testing framework.

Pyrostest is a (more) pythonic framework for writing ros tests.

## Why pyrostest?

Writing rostests and rostunit tests is annoying. You have to write launch files
for all of your tests and then do strange things in your unittests and then
somehow the rostests and unittests will communicate. To be honest, I never could
get rostest to work. So I built something better. `pyrostest` allows you to test
your ros nodes in pure python, no need for xml files.

## Usage

Here's a minimal example of a pyrostest test. Assume you have a ros node,
`add_one` in the ros package `pkg`. The node subscribes to `input`, a Float64
message, and published to `output`, another Float64, it adds one to the input
and publishes it. This would test that functionality

```python

from pyrostest import RosTest, launch_node, mock_node
from std_msgs.msg import Float64

class TestAddOne(RosTest):
@launch_node('pkg', 'add_one')
def test_add_one(self):
with self.mock_pub('/input', Float64, queue_size=0) as p:
with self.check_topic('/output', Float64) as r:
p.send(Float64(7))
assert r.message.data == 8 # or self.assertEqual

```

This code will spin up an isolated instance of Roscore, as well as all of the
nodes needed for testing. It will then publish the float 7, and wait until the
data has been recieved, and assert about its value.



Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyrostest-0.1.12.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyrostest-0.1.12-py2-none-any.whl (13.3 kB view details)

Uploaded Python 2

File details

Details for the file pyrostest-0.1.12.tar.gz.

File metadata

  • Download URL: pyrostest-0.1.12.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyrostest-0.1.12.tar.gz
Algorithm Hash digest
SHA256 5a46de86cdc25ef723d5a21db8486b9e52fba9b0ee269fb833e1fbc548384379
MD5 5eaad2a52be0563dc827c573fe255b10
BLAKE2b-256 aea641b142640bdc9cf7d4b640d4ad1e1bebbb82a0ab8551975c6b5edc6a8052

See more details on using hashes here.

File details

Details for the file pyrostest-0.1.12-py2-none-any.whl.

File metadata

File hashes

Hashes for pyrostest-0.1.12-py2-none-any.whl
Algorithm Hash digest
SHA256 777e52a987a0718f414d00bdb0c2f27492bce29a8e9ba058560b527ac389b3b1
MD5 7dec818fe85642d712befbdb3e69fcd7
BLAKE2b-256 6719099cabd0a2af37af74278e9a9a248a967ffcdf35eda39a084d9b51d4136e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page