pulp/pulp-smash

Create a decorator for checking if a particular executable (e.g. dnf, apt) is available

dralley opened this issue · 1 comments

Perhaps we should make one specific for package managers and one that's more general for any executable (e.g. lsof). but that's up for debate.

My general suggestion is to turn these couple of lines into a decorator provided by pulp-smash to avoid copy-pasting and facilitate other plugins (like debian) doing something similar.

https://github.com/pulp/pulp_rpm/blob/master/pulp_rpm/tests/functional/api/test_consume_content.py#L38

+1 I like the idea of transforming all the skip functions into decorators.

we can add the decorator functionality while keeping the backwards compatibility with the old style and allow the function to be used in specific cases where a decorator is not a fit.

I have implemented stuff like this in robozilla[1]

[1] https://github.com/SatelliteQE/robozilla/blob/master/robozilla/decorators/__init__.py#L465