-
Notifications
You must be signed in to change notification settings - Fork 6
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
Test Driven Development #3
Comments
Ohh |
I noticed a few interesting things that must be done when developing in a virtual environment and using both python 2.7 and 3.5 on the same computer. These are:
|
Also, when installing |
Alright. This might be easier to approach from the opposite direction and create a |
|
Well then. Looks like pyserial can be used for loopback tests with serial compliant objects pointing to a local loopback port... I'll be damned.... nifty. https://pythonhosted.org/pyserial/pyserial_api.html#serial.serial_for_url |
Oh wow, right on the front page of the documentation you can call a function with https://pythonhosted.org/pyserial/shortintro.html#listing-ports |
Progress! Ended up deleting a bunch of my code but I like this approach much better. I am now starting to use pyserial's url based serial connection and using the loopback device to make a test serial port which I can then treat as any other serial port! Literally using python serial library to interact. @kb1lqd @el-iso @reillyeon @hdkmike https://github.com/kb1lqc/faradayio/blob/initial/tests/serialtestclass.py
A SUPER simple test to make sure this works is shown below https://github.com/kb1lqc/faradayio/blob/initial/tests/test_serial.py This simply writes "Hello World!" to the serial port and then reads it's back using |
Synchronous serial port send and receive are working with unit testing! At least as much as I can figure that it's unit testing. Not currently testing all possible inputs or exceptions but it's a start. I'd like to move to asynchronous now that this is working.
It turns out |
@kb1lqd @reillyeon @hdkmike I sort of have a test working for asyncio based serial ports. I pretty much copied the pyserial-asyncio unit test and modified it for my own use. https://github.com/kb1lqc/faradayio/blob/initial/tests/test_serial.py#L143 This uses the Input and Output classes in the The problem I am having is that I can't seem to return a value from the test. I can only run the coroutine with The @pyserial any help would be appreciated! @bufferoverflow @zsquareplusc I really want to use |
I removed the https://github.com/kb1lqc/faradayio/tree/initial |
The documentation in |
This project will use the style of test driven development (TDD). This website explains it well.
The text was updated successfully, but these errors were encountered: