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

Enable labeling networks in network create #284

Merged
merged 4 commits into from
Nov 24, 2021

Conversation

Akshay04
Copy link
Contributor

Add missing functionality to docker network create function to add labels to network

Add missing functionality to docker network create function to add labels to network
@tot0
Copy link

tot0 commented Nov 23, 2021

Awesome thanks!

@gabrieldemarmiesse
Copy link
Owner

That's great! Thanks a lot! Could you add a small unit test? :)

@Akshay04
Copy link
Contributor Author

Added the unit test, I was having some trouble testing my changes locally. How do you typically do this?

@gabrieldemarmiesse
Copy link
Owner

gabrieldemarmiesse commented Nov 24, 2021

You need to install the linters and formatters:
Isort, black and flake 8. Run them at the root of the repo to check things.

Next to run the tests, install this package in editable mode pip install -e . from the root of the repo too.

Install the test requirements too
pip install -r tests/requirements.txt

Then run a test with
pytest path/to/file.py::function_to_run.

The test looks good. Could you just create the network with a context manager so that it's deleted afterwards even if there are exceptions?
with docker.network.create(...) as my_network:

@Akshay04
Copy link
Contributor Author

Will do, thanks for your help

@gabrieldemarmiesse gabrieldemarmiesse merged commit 5067f4e into gabrieldemarmiesse:master Nov 24, 2021
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.

4 participants