File: example1.3.py

package info (click to toggle)
python-allpairspy 2.5.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 204 kB
  • sloc: python: 627; makefile: 42; sh: 6
file content (29 lines) | stat: -rwxr-xr-x 748 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env python3

"""
Demo of the basic functionality - just getting pairwise combinations
and skipping previously tested pairs.
"""

from allpairspy import AllPairs


parameters = [
    ["Brand X", "Brand Y"],
    ["98", "NT", "2000", "XP"],
    ["Internal", "Modem"],
    ["Salaried", "Hourly", "Part-Time", "Contr."],
    [6, 10, 15, 30, 60],
]
# sample parameters are is taken from
# http://www.stsc.hill.af.mil/consulting/sw_testing/improvement/cst.html

tested = [
    ["Brand X", "98", "Modem", "Hourly", 10],
    ["Brand X", "98", "Modem", "Hourly", 15],
    ["Brand Y", "NT", "Internal", "Part-Time", 10],
]

print("PAIRWISE:")
for i, pairs in enumerate(AllPairs(parameters, previously_tested=tested)):
    print(f"{i:2d}: {pairs}")