Commit f0b55291 authored by ale's avatar ale
Browse files

Add a simpler example config to the README

parent ccd9aaa6
Pipeline #7987 passed with stages
in 1 minute and 47 seconds
......@@ -14,12 +14,23 @@ with a `.py` extension. These Python modules should define a top-level
Probes should be instances of Probe objects, that compose the
individual probe functions defined in the [probes/](./probes/)
directory with different sets of parameters, stored in the *probe
context*. This is facilitated by the *parameterize* function, that
creates list of contexts by parameterizing a single attribute, for
example:
context*. A simple configuration with a single probe could be:
```python
test_credentials= [
creds = Credentials(username='foo', password='bar')
PROBES = [
Probe(probe_xmpp, 'jabber', {
'server': 'jabber.autistici.org',
'credentials': creds,
})]
```
Running the same probe over a set of similar parameters can be
facilitated by the *parameterize* function, that creates list of
contexts by parameterizing a single attribute, for example:
```python
creds = [
Credentials(username='user1', password='pass1'),
Credentials(username='user2', password='pass2')]
PROBES = parameterize(
......@@ -30,12 +41,12 @@ PROBES = parameterize(
'url': 'https://webmail.example.com'
}),
'credentials',
test_credentials)
creds)
```
The above snippet will create two instances of the *probe_webmail*
probe, each pointing at the same URL but with performing the login
with different test users.
probe, each pointing at the same URL but performing the login with
different test users.
Probes are named by concatenating the base name (here "webmail") with
the values passed to parameterize(), so in this case we would have
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment