Open conorsch opened 7 years ago
Hi,
Instead of
@pytest.fixture()
def X509Certificate():
x = _X509Certificate
return x
Try
X509Certificate = _X509Certificate.as_fixture()
And instead of c = Command(...)
: c = self.run(...)
Agree that extending modules is not simple, maybe a monkeypatch could be even simple ?
Have you got it working?
Never did cobble together an implementation to my liking, currently using a hodge-podge of other tools to get the job done. Very interested in your results if you're successful, @mihai-satmarean !
Given the discussion in https://github.com/philpep/testinfra/issues/233#issue-252744553, it seems like this is a duplicate and somehow outdated since the recommended solution API has been removed?
I came across this today. I followed your example and got this working. https://github.com/awalker125/testinfra-extension-poc/blob/master/tests/fixtures/kubectl_binary.py
Its not exactly the same usecase but it does the job for me.
Hello @philpep, thanks for the great project. I'm struggling to write custom testinfra modules that extend the builtins, e.g.
File
. Right now I'm trying to write a module for checking attributes for X509 SSL certs, similar to what serverspec already provides. The example docs are too simple for this use case:Here's the class-based approach I'm taking:
Can you point me in the right direction here? I've been banging my head against this for a while now. Happy to submit a docs PR once I have a working example!