Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test suite #64

Open
brentru opened this issue Feb 3, 2021 · 2 comments
Open

Add test suite #64

brentru opened this issue Feb 3, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@brentru
Copy link
Member

brentru commented Feb 3, 2021

Similar to work done within requests (https://github.com/adafruit/Adafruit_CircuitPython_Requests/tree/master/tests), this library should have a test suite which tests the MQTT protocol

@brentru brentru added the enhancement New feature or request label Feb 3, 2021
@vladak
Copy link
Contributor

vladak commented Nov 28, 2023

Here's one idea for testing: it might be worthwhile to use a good MQTT server implementation (such as Mosquitto). For a functional PUBLISH test it might look like this:

  1. start the server
  2. distinct client implementation (such as Paho or Mosquitto) subscribes to a topic
  3. MiniMQTT publishes a message to the topic
  4. the client from step 2 and/or the server will verify that the message arrived

@vladak
Copy link
Contributor

vladak commented Dec 17, 2023

Another idea which I started to implement in PR #187 is to fake the state and produce/capture socket data and verify it against the data sent by known good MQTT client implementation. This is based on the "Mocket" idea from adafruit_requests and a set of private tests I've written recently for custom almost-MQTT server implementation (these tests are used for evaluation of a final assignment for Unix system programming class at Charles university in Prague to complement public set of tests). This will provide protocol level testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants