Skip to content

Commit

Permalink
Tests for CEPAddress invalid attr & adds coverage badge
Browse files Browse the repository at this point in the history
  • Loading branch information
cauethenorio committed Mar 29, 2021
1 parent 04d2268 commit ac8da7f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/coverage-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ jobs:
run: |
coverage run --source simplecep -m pytest
coverage report -m
coverage html
- name: Coveralls
uses: AndreMiras/coveralls-python-action@develop
with:
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# simpleCEP

[![PyPI badge](https://img.shields.io/pypi/v/simplecep.svg)](https://pypi.python.org/pypi/simplecep) [![Compatible Python Versions](https://img.shields.io/pypi/pyversions/simplecep.svg)](https://pypi.python.org/pypi/simplecep)
[![PyPI badge](https://img.shields.io/pypi/v/simplecep.svg)](https://pypi.python.org/pypi/simplecep)
[![Coverage Status](https://coveralls.io/repos/github/cauethenorio/simplecep/badge.svg?branch=main)](https://coveralls.io/github/cauethenorio/simplecep?branch=main)
[![Compatible Python Versions](https://img.shields.io/pypi/pyversions/simplecep.svg)](https://pypi.python.org/pypi/simplecep)

Reliably resolve Brazilian CEP addresses using multiple APIs.

Expand Down
1 change: 1 addition & 0 deletions tests/providers/providers_tests_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
"street": "Rua Amoreira",
},
},
# tests for invalid/non-existent cep numbers
{"input": "00000000", "expected_result": None},
{"input": "11111111", "expected_result": None},
{"input": "99999999", "expected_result": None},
Expand Down
4 changes: 4 additions & 0 deletions tests/test_cepaddress.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,7 @@ def test_br_fields_access():
assert address2.cidade is address_data2["city"]
assert address2.bairro is None
assert address2.street is None

# __getattr__ should raise AttributeError for invalid keys
with pytest.raises(AttributeError):
address.eestado

0 comments on commit ac8da7f

Please sign in to comment.