Skip to content

Commit

Permalink
improve test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
vvmruder committed Nov 28, 2023
1 parent 44b96b8 commit 1e310c0
Show file tree
Hide file tree
Showing 8 changed files with 1,215 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .coveragerc.contrib-data_sources-oereblex
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[run]
source =
pyramid_oereb/contrib/data_sources/oereblex/*.py
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -318,12 +318,16 @@ test-contrib-data_sources-standard: ${VENV_ROOT}/requirements-timestamp
test-contrib-data_sources-interlis: ${VENV_ROOT}/requirements-timestamp
$(VENV_BIN)/py.test -vv $(PYTEST_OPTS) --cov-config .coveragerc.contrib-data_sources-interlis --cov $(PACKAGE)/contrib/data_sources/interlis_2_3 --cov-report=term-missing:skip-covered --cov-report=xml:coverage.contrib-data_sources-interlis.xml tests/contrib.data_sources.interlis_2_3

.PHONY: test-contrib-data_sources-oereblex
test-contrib-data_sources-oereblex: ${VENV_ROOT}/requirements-timestamp
$(VENV_BIN)/py.test -vv $(PYTEST_OPTS) --cov-config .coveragerc.contrib-data_sources-oereblex --cov $(PACKAGE)/contrib/data_sources/oereblex --cov-report=term-missing:skip-covered --cov-report=xml:coverage.contrib-data_sources-oereblex.xml tests/contrib.data_sources.oereblex

.PHONY: test-contrib-stats
test-contrib-stats: ${VENV_ROOT}/requirements-timestamp
$(VENV_BIN)/py.test -vv $(PYTEST_OPTS) --cov-config .coveragerc.contrib-stats --cov $(PACKAGE)/contrib/stats --cov-report=xml:coverage.contrib-stats.xml tests/contrib.stats

.PHONY: tests
tests: ${VENV_ROOT}/requirements-timestamp test-core test-contrib-print_proxy-mapfish_print test-contrib-data_sources-standard test-contrib-data_sources-interlis test-contrib-stats
tests: ${VENV_ROOT}/requirements-timestamp test-core test-contrib-print_proxy-mapfish_print test-contrib-data_sources-standard test-contrib-data_sources-interlis test-contrib-stats test-contrib-data_sources-oereblex

.PHONY: docker-tests
docker-tests:
Expand Down
280 changes: 280 additions & 0 deletions coverage.contrib-data_sources-oereblex.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,280 @@
<?xml version="1.0" ?>
<coverage version="7.3.1" timestamp="1701193565293" lines-valid="226" lines-covered="193" line-rate="0.854" branches-covered="0" branches-valid="0" branch-rate="0" complexity="0">
<!-- Generated by coverage.py: https://coverage.readthedocs.io/en/7.3.1 -->
<!-- Based on https://raw.githubusercontent.com/cobertura/web/master/htdocs/xml/coverage-04.dtd -->
<sources>
<source>/workspace/pyramid_oereb/contrib/data_sources/oereblex</source>
</sources>
<packages>
<package name="." line-rate="0" branch-rate="0" complexity="0">
<classes>
<class name="__init__.py" filename="__init__.py" complexity="0" line-rate="1" branch-rate="0">
<methods/>
<lines/>
</class>
<class name="create_tables.py" filename="create_tables.py" complexity="0" line-rate="0" branch-rate="0">
<methods/>
<lines>
<line number="2" hits="0"/>
<line number="3" hits="0"/>
<line number="5" hits="0"/>
<line number="9" hits="0"/>
<line number="10" hits="0"/>
<line number="13" hits="0"/>
<line number="14" hits="0"/>
<line number="18" hits="0"/>
<line number="25" hits="0"/>
<line number="33" hits="0"/>
<line number="40" hits="0"/>
<line number="45" hits="0"/>
<line number="52" hits="0"/>
<line number="60" hits="0"/>
<line number="61" hits="0"/>
<line number="62" hits="0"/>
<line number="64" hits="0"/>
<line number="65" hits="0"/>
<line number="66" hits="0"/>
<line number="74" hits="0"/>
<line number="75" hits="0"/>
<line number="76" hits="0"/>
</lines>
</class>
</classes>
</package>
<package name="models" line-rate="1" branch-rate="0" complexity="0">
<classes>
<class name="__init__.py" filename="models/__init__.py" complexity="0" line-rate="1" branch-rate="0">
<methods/>
<lines/>
</class>
<class name="theme.py" filename="models/theme.py" complexity="0" line-rate="1" branch-rate="0">
<methods/>
<lines>
<line number="1" hits="1"/>
<line number="2" hits="1"/>
<line number="3" hits="1"/>
<line number="4" hits="1"/>
<line number="6" hits="1"/>
<line number="14" hits="1"/>
<line number="16" hits="1"/>
<line number="20" hits="1"/>
<line number="21" hits="1"/>
<line number="22" hits="1"/>
<line number="23" hits="1"/>
<line number="24" hits="1"/>
<line number="25" hits="1"/>
<line number="26" hits="1"/>
<line number="27" hits="1"/>
<line number="30" hits="1"/>
<line number="44" hits="1"/>
<line number="46" hits="1"/>
<line number="47" hits="1"/>
<line number="48" hits="1"/>
<line number="50" hits="1"/>
<line number="77" hits="1"/>
<line number="78" hits="1"/>
<line number="79" hits="1"/>
<line number="80" hits="1"/>
<line number="81" hits="1"/>
<line number="82" hits="1"/>
<line number="83" hits="1"/>
<line number="84" hits="1"/>
<line number="88" hits="1"/>
<line number="92" hits="1"/>
<line number="96" hits="1"/>
<line number="97" hits="1"/>
<line number="101" hits="1"/>
<line number="103" hits="1"/>
<line number="105" hits="1"/>
<line number="112" hits="1"/>
<line number="123" hits="1"/>
<line number="126" hits="1"/>
<line number="137" hits="1"/>
</lines>
</class>
</classes>
</package>
<package name="sources" line-rate="0.9329" branch-rate="0" complexity="0">
<classes>
<class name="__init__.py" filename="sources/__init__.py" complexity="0" line-rate="1" branch-rate="0">
<methods/>
<lines/>
</class>
<class name="document.py" filename="sources/document.py" complexity="0" line-rate="0.9344" branch-rate="0">
<methods/>
<lines>
<line number="2" hits="1"/>
<line number="4" hits="1"/>
<line number="5" hits="1"/>
<line number="6" hits="1"/>
<line number="7" hits="1"/>
<line number="9" hits="1"/>
<line number="10" hits="1"/>
<line number="11" hits="1"/>
<line number="14" hits="1"/>
<line number="17" hits="1"/>
<line number="22" hits="1"/>
<line number="45" hits="1"/>
<line number="48" hits="1"/>
<line number="49" hits="1"/>
<line number="50" hits="1"/>
<line number="51" hits="1"/>
<line number="52" hits="1"/>
<line number="53" hits="1"/>
<line number="54" hits="1"/>
<line number="55" hits="1"/>
<line number="57" hits="1"/>
<line number="60" hits="1"/>
<line number="61" hits="1"/>
<line number="62" hits="1"/>
<line number="63" hits="1"/>
<line number="65" hits="1"/>
<line number="66" hits="1"/>
<line number="67" hits="1"/>
<line number="69" hits="1"/>
<line number="71" hits="1"/>
<line number="72" hits="1"/>
<line number="73" hits="1"/>
<line number="75" hits="1"/>
<line number="76" hits="1"/>
<line number="77" hits="1"/>
<line number="79" hits="1"/>
<line number="80" hits="1"/>
<line number="82" hits="1"/>
<line number="83" hits="1"/>
<line number="84" hits="1"/>
<line number="85" hits="1"/>
<line number="87" hits="1"/>
<line number="88" hits="1"/>
<line number="89" hits="1"/>
<line number="90" hits="1"/>
<line number="92" hits="1"/>
<line number="93" hits="1"/>
<line number="94" hits="1"/>
<line number="97" hits="1"/>
<line number="107" hits="1"/>
<line number="109" hits="1"/>
<line number="110" hits="1"/>
<line number="112" hits="1"/>
<line number="114" hits="1"/>
<line number="115" hits="1"/>
<line number="116" hits="0"/>
<line number="119" hits="1"/>
<line number="127" hits="1"/>
<line number="128" hits="1"/>
<line number="131" hits="1"/>
<line number="132" hits="1"/>
<line number="133" hits="1"/>
<line number="136" hits="1"/>
<line number="137" hits="1"/>
<line number="138" hits="1"/>
<line number="139" hits="1"/>
<line number="141" hits="1"/>
<line number="155" hits="1"/>
<line number="156" hits="1"/>
<line number="159" hits="1"/>
<line number="162" hits="1"/>
<line number="163" hits="1"/>
<line number="164" hits="1"/>
<line number="165" hits="1"/>
<line number="166" hits="1"/>
<line number="167" hits="1"/>
<line number="169" hits="1"/>
<line number="171" hits="1"/>
<line number="172" hits="1"/>
<line number="175" hits="1"/>
<line number="176" hits="1"/>
<line number="178" hits="0"/>
<line number="181" hits="1"/>
<line number="182" hits="1"/>
<line number="184" hits="0"/>
<line number="185" hits="1"/>
<line number="187" hits="1"/>
<line number="190" hits="1"/>
<line number="191" hits="0"/>
<line number="193" hits="0"/>
<line number="196" hits="1"/>
<line number="197" hits="0"/>
<line number="198" hits="1"/>
<line number="199" hits="0"/>
<line number="200" hits="1"/>
<line number="201" hits="0"/>
<line number="202" hits="1"/>
<line number="203" hits="1"/>
<line number="205" hits="1"/>
<line number="208" hits="1"/>
<line number="211" hits="1"/>
<line number="214" hits="1"/>
<line number="215" hits="1"/>
<line number="216" hits="1"/>
<line number="230" hits="1"/>
<line number="232" hits="1"/>
<line number="234" hits="1"/>
<line number="235" hits="1"/>
<line number="249" hits="1"/>
<line number="251" hits="1"/>
<line number="265" hits="1"/>
<line number="266" hits="1"/>
<line number="267" hits="1"/>
<line number="268" hits="1"/>
<line number="269" hits="1"/>
<line number="270" hits="1"/>
<line number="271" hits="1"/>
<line number="273" hits="1"/>
<line number="274" hits="1"/>
<line number="288" hits="1"/>
<line number="289" hits="1"/>
<line number="292" hits="1"/>
</lines>
</class>
<class name="plr_oereblex.py" filename="sources/plr_oereblex.py" complexity="0" line-rate="0.9286" branch-rate="0">
<methods/>
<lines>
<line number="2" hits="1"/>
<line number="4" hits="1"/>
<line number="5" hits="1"/>
<line number="6" hits="1"/>
<line number="7" hits="1"/>
<line number="9" hits="1"/>
<line number="12" hits="1"/>
<line number="18" hits="1"/>
<line number="38" hits="1"/>
<line number="39" hits="1"/>
<line number="40" hits="1"/>
<line number="41" hits="1"/>
<line number="42" hits="1"/>
<line number="44" hits="1"/>
<line number="45" hits="1"/>
<line number="53" hits="1"/>
<line number="54" hits="1"/>
<line number="55" hits="1"/>
<line number="56" hits="1"/>
<line number="58" hits="1"/>
<line number="59" hits="1"/>
<line number="60" hits="1"/>
<line number="62" hits="1"/>
<line number="70" hits="1"/>
<line number="71" hits="1"/>
<line number="72" hits="1"/>
<line number="73" hits="1"/>
<line number="74" hits="1"/>
<line number="75" hits="1"/>
<line number="79" hits="1"/>
<line number="82" hits="1"/>
<line number="97" hits="1"/>
<line number="99" hits="1"/>
<line number="100" hits="1"/>
<line number="101" hits="0"/>
<line number="102" hits="0"/>
<line number="104" hits="1"/>
<line number="105" hits="1"/>
<line number="107" hits="1"/>
<line number="108" hits="1"/>
<line number="110" hits="1"/>
<line number="122" hits="0"/>
</lines>
</class>
</classes>
</package>
</packages>
</coverage>
2 changes: 2 additions & 0 deletions pyramid_oereb/contrib/data_sources/oereblex/models/theme.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ def model_factory(schema_name, pk_type, geometry_type, srid, db_connection):
needs
geometry_type (str): The geoalchemy geometry type defined as well known string.
srid (int): The SRID defining the projection of the geometries stored in standard db schema.
Returns:
Models: The models from factory wrapped in an intermediate object.
"""
Base = declarative_base()

Expand Down
Loading

0 comments on commit 1e310c0

Please sign in to comment.