Closed EricNeville closed 3 years ago
Merging #122 (e5c9dea) into dev (bf730db) will decrease coverage by
0.20%
. The diff coverage is80.76%
.
@@ Coverage Diff @@
## dev #122 +/- ##
==========================================
- Coverage 98.56% 98.36% -0.21%
==========================================
Files 6 6
Lines 4545 4597 +52
==========================================
+ Hits 4480 4522 +42
- Misses 65 75 +10
Impacted Files | Coverage Δ | |
---|---|---|
daftlistings/daft.py | 81.06% <50.00%> (-4.17%) |
:arrow_down: |
daftlistings/enums.py | 100.00% <100.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update bf730db...e5c9dea. Read the comment docs.
For testing, I can't just add a facility filter to the current search test because the search there is of SearchType New Homes and that type has no facilities. If it is okay to change that to a different search then I can do so.
Great work, thanks @EricNeville! To get some test coverage for this PR, you could update test_search, change the search type and add your set_facility
method. You'll need to also update the expected payload.
Sounds good, doing that now. I just wanted to make sure it's okay to change that. I'm not too familiar with these tests so am I right in thinking I just need to change the search type to say RESIDENTIAL_SALE and add my facility filter in the Daft object, and then reflect these two changes in the expected payload i.e changing section and adding andFilters accordingly?
Exactly, that sounds good. The test just ensures that when the Daft class methods are set the payload is constructured properly.
Added ability to filter searches by facilities. Compared to other filters already included, the available facilities for search are heavily dependent on the SearchType. As a result there are checks for SearchType being set before facilities as well as compatibility of Facility with SearchType. This closes #121. For example:
returns output:
ValueError: SearchType must be set before Facility
and:
returns output:
An example of searching for facilities is also included in the examples folder and the README.