Skip to content

Commit

Permalink
Merge pull request #84 from hlin/master
Browse files Browse the repository at this point in the history
Add more tests
  • Loading branch information
hlin authored Jul 23, 2019
2 parents 82f81bc + 9209d26 commit 4cbdaa0
Show file tree
Hide file tree
Showing 17 changed files with 390 additions and 155 deletions.
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

prod-listings-manager.png and prod-listings-manager.svg are licensed under a
Creative Commons Attribution 3.0 Unported license (CC BY 3.0).
misc/prod-listings-manager.png and misc/prod-listings-manager.svg are licensed
under a Creative Commons Attribution 3.0 Unported license (CC BY 3.0).
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Goals with this project
Architecture diagram
--------------------

.. image:: prod-listings-manager.png
.. image:: misc/prod-listings-manager.png
:width: 958px
:align: center
:height: 364px
Expand Down
File renamed without changes
File renamed without changes
13 changes: 2 additions & 11 deletions product-listings-manager.spec
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ BuildRequires: python3-flask-sqlalchemy
BuildRequires: python3-flask-restful
BuildRequires: python3-koji
BuildRequires: python3-psycopg2
BuildRequires: python3-pytest
BuildRequires: python3-setuptools
BuildRequires: python3-sqlalchemy
BuildRequires: python3-mock
Requires: python3-flask
Requires: python3-flask-sqlalchemy
Requires: python3-flask-restful
Expand All @@ -40,8 +39,7 @@ BuildRequires: python-psycopg2
BuildRequires: python-sqlalchemy
BuildRequires: python2-flask-restful
BuildRequires: python2-koji
BuildRequires: pytest
BuildRequires: python-mock
BuildRequires: python2-setuptools
Requires: python-flask
Requires: python-flask-sqlalchemy
Requires: python-sqlalchemy
Expand Down Expand Up @@ -75,13 +73,6 @@ composedb.
mkdir -p %{buildroot}%{_sysconfdir}/%{name}
cp -p %{modname}/config.py %{buildroot}%{_sysconfdir}/%{name}

%check
%if %{with python3}
py.test-3 -v %{modname}/tests
%else
py.test-2.7 -v %{modname}/tests
%endif

%files
%license LICENSE
%doc README.rst
Expand Down
2 changes: 1 addition & 1 deletion product_listings_manager/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,4 @@ class ModuleOverrides(db.Model):
product_arch = db.Column(db.String(32), primary_key=True)

def __repr__(self):
return '<ModuleOverrides %s %s>' % (self.name, self.stream, self.product, self.product_arch)
return '<ModuleOverrides %s %s %d %s>' % (self.name, self.stream, self.product, self.product_arch)
Empty file.
15 changes: 0 additions & 15 deletions product_listings_manager/tests/test_http_404.py

This file was deleted.

112 changes: 0 additions & 112 deletions product_listings_manager/tests/test_rest_api_v1.py

This file was deleted.

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def read_module_contents():
url='https://github.com/release-engineering/product-listings-manager',
license='MIT',
long_description=LONG_DESCRIPTION,
packages=find_packages(),
packages=find_packages(exclude=['tests']),
install_requires=[
'Flask',
'Flask-Restful',
Expand Down
8 changes: 8 additions & 0 deletions product_listings_manager/conftest.py → tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import json
import pytest

from product_listings_manager.app import create_app


if not hasattr(Response, 'get_json'):
def get_json(self, force=False, silent=False, cache=True):
Expand All @@ -27,3 +29,9 @@ def pytest_collection_modifyitems(config, items):
for item in items:
if "live" in item.keywords:
item.add_marker(skip_live)


@pytest.fixture
def client():
client = create_app().test_client()
yield client
4 changes: 4 additions & 0 deletions tests/test_http_404.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class TestHttp404(object):
def test_http_404(self, client):
r = client.get('/nonexistent')
assert r.status_code == 404
File renamed without changes.
Loading

0 comments on commit 4cbdaa0

Please sign in to comment.