Task #6069
closed
Use bindings in the pulp_container functional tests
Status:
CLOSED - CURRENTRELEASE
0 - update your pulplift (it has an alias for installing bindings)
0.1 - pulplift automatically install the bindings for you
0.2 - if you have to generate bindings: $pbindings pulp_container python
1 - for exploring python bindings, go to ipython:
[1] from pulpcore.client import pulp_container
[2] dir(pulp_container)
[3] pulp_container.SomeClass??
2 - pulp_file example is here: https://github.com/pulp/pulp_file/pull/347/files
pulpcore example: https://github.com/pulp/pulpcore/blob/master/.travis/test_bindings.py
3 - the main difference is pulp_file has only one content type, so maybe instead of ContainerContentApi it could be something like ContainerBlobContentApi
3.1 - you'll get the names with step (1) above
4 - test_download_content has the full workflow: sync, publish, distribution
4.1 - pulp_container/tests/functional/utils.py has some methods you will need
5 - use plugin_template:
$ ./plugin-template --bootstrap pulp_container
5.1 - then discard everything but test_download_content, and maybe utils
5.1.1 - it is just a few methods introduced in utils, maybe it is better to do it manually, because plugin_template can change a lot of things,
so you decide whether to keep or discard changes made by plugin_template
6 - my approach would be: use plugin_template and check which file will need just few adjustments and which file would be better to rewrite everything manually
- Status changed from NEW to ASSIGNED
- Assignee set to lmjachky
- Description updated (diff)
- Tags API Bindings added
- Description updated (diff)
- Groomed changed from No to Yes
- Sprint set to Sprint 65
- Sprint changed from Sprint 65 to Sprint 66
I made a workaround for replacing None by empty strings, apparently, it was enough to solve the issue, but I'm not sure if it could affect other use cases. Maybe we can write a special DetailRelatedField:
https://github.com/pulp/pulpcore/pull/536
- Status changed from ASSIGNED to POST
- Sprint changed from Sprint 66 to Sprint 67
- Status changed from POST to MODIFIED
- % Done changed from 0 to 100
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Also available in: Atom
PDF
Convert functional tests to use bindings
In addition, the test test_convert.py was moved to the directory tests/unit/.
closes #6069 https://pulp.plan.io/issues/6069