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 unit tests #291

Merged
merged 4 commits into from
Aug 21, 2022
Merged

Add unit tests #291

merged 4 commits into from
Aug 21, 2022

Conversation

caheredia
Copy link
Contributor

@caheredia caheredia commented Aug 20, 2022

Why

This PR introduces a framework for unit testing the repo. Docker-compose builds the environment by running the make up command. With the container running, the tests are run with make test. This same command will also run any additional tests added to the test directory.

I used the standard library test runner (unittest) because I didn't want to alter any source code or the original requirements.txt manifest. However, I added a test.Dockerfile file because the original installed the rebalance-lnd package. I wanted the flexibility to dev without rebuilding and reinstalling the environment.

What

  • Built test container environment
  • Added test runner command
  • Tested output.py functions
  • Added test README

@caheredia caheredia mentioned this pull request Aug 20, 2022
@C-Otto C-Otto merged commit f42b605 into C-Otto:main Aug 21, 2022
@C-Otto
Copy link
Owner

C-Otto commented Aug 21, 2022

Thanks a lot! This works using your docker approach, but not inside IntelliJ IDEA. Test cases that contain color/formatting magic in the output string don't pass the assertEqual assertion. Any idea how to fix this?

@caheredia
Copy link
Contributor Author

@C-Otto Sorry I don't. I have a love/hate relationship with PyCharm. Sometimes it does too much This might be one of those cases. I tried to debug on my end. No luck. I suspect it PyCharm is changing the file encoding or interpreting the characters in the tests to how they should render instead of literal characters in the test cases.

@caheredia caheredia deleted the add_unit_tests branch August 21, 2022 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants