File tree Expand file tree Collapse file tree 10 files changed +122
-0
lines changed Expand file tree Collapse file tree 10 files changed +122
-0
lines changed Original file line number Diff line number Diff line change 104104* .txt
105105* .pickle
106106* .zip
107+
108+ # BDD Testing
109+ testing /
110+ ! test-requirements.txt
Original file line number Diff line number Diff line change @@ -34,6 +34,21 @@ Install from PyPi
3434
3535 pip install py-ard
3636
37+ Testing
38+
39+ -------
40+ To run behavior-driven development (BDD) tests locally via the behave framework,
41+ you'll need to set up a virtual environment.
42+
43+ .. code-block ::
44+ # Virtual environment setup
45+ python3 -m venv testing
46+ source testing/bin/activate
47+ pip install --upgrade pip
48+ pip install -r test-requirements.txt
49+
50+ # Running Behave and all BDD tests
51+ behave
3752
3853 Example
3954-------
Original file line number Diff line number Diff line change 1+ [behave]
2+ paths =tests
3+ format =pretty
4+ show_snippets =false
5+
6+ ; Development
7+ stop =true
Original file line number Diff line number Diff line change 1+ behave==1.2.6
2+ pandas==0.25.1
3+ PyHamcrest==2.0.2
Original file line number Diff line number Diff line change 1+ from pyard import ARD
2+
3+ def before_all (context ):
4+ context .ard = ARD (verbose = True )
Original file line number Diff line number Diff line change 1+ Feature : Alleles
2+
3+ Scenario Outline :
4+
5+ Given the allele as <Allele>
6+ When reducing on the <Level> level
7+ Then the reduced allele is found to be <Redux Allele>
8+
9+ Examples :
10+ | Allele | Level | Redux Allele |
11+ | A *01 :01 :01 | G | A *01 :01 :01G |
12+ | A *01 :01 :01 | lg | A *01 :01g |
13+ | A *01 :01 :01 | lgx | A *01 :01 |
14+
15+ | HLA -A *01 :01 :01 | G | HLA -A *01 :01 :01G |
16+ | HLA -A *01 :01 :01 | lg | HLA -A *01 :01g |
17+ | HLA -A *01 :01 :01 | lgx | HLA -A *01 :01 |
18+
19+ | DRB1 *14 :05 :01 | lgx | DRB1 *14 :05 |
20+ | DRB1 *14 :05 :01 | lg | DRB1 *14 :05g |
21+
22+ | DRB1 *14 :06 :01 | lgx | DRB1 *14 :06 |
23+ | DRB1 *14 :06 :01 | lg | DRB1 *14 :06g |
Original file line number Diff line number Diff line change 1+ Feature : GL (Genotype List) Strings
2+
3+ Scenario Outline :
4+
5+ Given the allele as <Allele>
6+ When reducing on the <Level> level (ambiguous)
7+ Then the reduced allele is found to be <Redux Allele>
8+
9+ Examples :
10+ | Allele | Level | Redux Allele |
11+ | A *01 :01 :01 :01 +A *01 :01 :01 :01 | G | A *01 :01 :01G +A *01 :01 :01G |
12+ | HLA -A *01 :01 :01 :01 +HLA -A *01 :01 :01 :01 | G | HLA -A *01 :01 :01G +HLA -A *01 :01 :01G |
13+ | A *01 :01 :01 :01 +A *01 :01 :01 :01 | lg | A *01 :01g +A *01 :01g |
14+ | HLA -A *01 :01 :01 :01 +HLA -A *01 :01 :01 :01 | lg | HLA -A *01 :01g +HLA -A *01 :01g |
15+ | A *01 :01 :01 :01 +A *01 :01 :01 :01 | lgx | A *01 :01 +A *01 :01 |
16+ | HLA -A *01 :01 :01 :01 +HLA -A *01 :01 :01 :01 | lgx | HLA -A *01 :01 +HLA -A *01 :01 |
17+ | A *01 :01 +A *01 :01 ^B *07 :02 +B *07 :02 | G | A *01 :01 :01G +A *01 :01 :01G ^B *07 :02 :01G +B *07 :02 :01G |
18+ | A *01 :01 +A *01 :01 ^B *07 :02 +B *07 :02 | lg | A *01 :01g +A *01 :01g ^B *07 :02g +B *07 :02g |
19+ | A *01 :01 ~B *07 :02 +A *01 :01 ~B *07 :02 | G | A *01 :01 :01G ~B *07 :02 :01G +A *01 :01 :01G ~B *07 :02 :01G |
20+ | A *01 :01 ~B *07 :02 +A *01 :01 ~B *07 :02 | lg | A *01 :01g ~B *07 :02g +A *01 :01g ~B *07 :02g |
21+ | A *01 :01 ~B *07 :02 +A *01 :01 ~B *07 :02 \|A *02 :01 ~B *07 :02 +A *02 :01 ~B *07 :02 | lg | A *01 :01g ~B *07 :02g +A *01 :01g ~B *07 :02g \|A *02 :01g ~B *07 :02g +A *02 :01g ~B *07 :02g |
Original file line number Diff line number Diff line change 1+ Feature : MAC (Multiple Allele Code )
2+
3+ Scenario Outline :
4+
5+ Given the allele as <Allele>
6+ When reducing on the <Level> level (ambiguous)
7+ Then the reduced allele is found to be <Redux Allele>
8+
9+ Examples :
10+ | Allele | Level | Redux Allele |
11+ | A *01 :AB | G | A *01 :01 :01G /A *01 :02 |
12+ | A *01 :AB | lgx | A *01 :01 /A *01 :02 |
13+ | HLA -A *01 :AB | G | HLA -A *01 :01 :01G /HLA -A *01 :02 |
14+ | HLA -A *01 :AB | lgx | HLA -A *01 :01 /HLA -A *01 :02 |
Original file line number Diff line number Diff line change 1+ Feature : P and G Groups
2+
3+ Scenario Outline :
4+
5+ Given the allele as <Allele>
6+ When reducing on the <Level> level (ambiguous)
7+ Then the reduced allele is found to be <Redux Allele>
8+
9+ Examples :
10+ | Allele | Level | Redux Allele |
11+ | A *02 :01P | lgx | A *02 :01 |
12+ | A *02 :01 :01G | lgx | A *02 :01 |
Original file line number Diff line number Diff line change 1+ from hamcrest import assert_that , is_
2+
3+ @given ('the allele as {allele}' )
4+ def step_impl (context , allele ):
5+ context .allele = allele
6+
7+ @when ('reducing on the {level} level' )
8+ def step_impl (context , level ):
9+ context .level = level
10+ context .redux_allele = context .ard .redux (context .allele , level )
11+
12+ @when ('reducing on the {level} level (ambiguous)' )
13+ def step_impl (context , level ):
14+ context .level = level
15+ context .redux_allele = context .ard .redux_gl (context .allele , level )
16+
17+ @then ('the reduced allele is found to be {redux_allele}' )
18+ def step_impl (context , redux_allele ):
19+ assert_that (context .redux_allele , is_ (redux_allele ))
You can’t perform that action at this time.
0 commit comments