Add PyLint
This commit is contained in:
+5
-3
@@ -1,6 +1,6 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
import httpretty
|
||||
import os
|
||||
import httpretty
|
||||
import pytest
|
||||
|
||||
from stw_potsdam import canteen_api
|
||||
@@ -21,11 +21,13 @@ def api_online_one_shot():
|
||||
|
||||
Subsequent API invocations will return with HTTP status code 500.
|
||||
"""
|
||||
# pylint: disable=unused-argument
|
||||
def canned_menu(request, uri, response_headers):
|
||||
path = os.path.join(os.path.dirname(__file__),
|
||||
'resources', 'input.json')
|
||||
with open(path) as f:
|
||||
return 200, response_headers, f.read()
|
||||
|
||||
with open(path) as api_response:
|
||||
return 200, response_headers, api_response.read()
|
||||
|
||||
responses = [
|
||||
httpretty.Response(body=canned_menu),
|
||||
|
||||
@@ -17,18 +17,18 @@ def _canteen():
|
||||
|
||||
|
||||
def _menu():
|
||||
with open(_resource_path('input.json')) as f:
|
||||
return json.load(f)
|
||||
with open(_resource_path('input.json')) as menu_file:
|
||||
return json.load(menu_file)
|
||||
|
||||
|
||||
def _expected_meta_feed():
|
||||
with io.open(_resource_path('meta_output.xml'), encoding='utf-8') as f:
|
||||
return f.read()
|
||||
with io.open(_resource_path('meta_output.xml'), encoding='utf-8') as xml:
|
||||
return xml.read()
|
||||
|
||||
|
||||
def _expected_menu_feed():
|
||||
with io.open(_resource_path('menu_output.xml'), encoding='utf-8') as f:
|
||||
return f.read()
|
||||
with io.open(_resource_path('menu_output.xml'), encoding='utf-8') as xml:
|
||||
return xml.read()
|
||||
|
||||
|
||||
def test_meta_consistency():
|
||||
|
||||
@@ -8,6 +8,8 @@ from stw_potsdam.config import read_canteen_config
|
||||
from stw_potsdam.canteen_api import download_menu
|
||||
from stw_potsdam.canteen_api import MenuParams
|
||||
|
||||
# pragma pylint: disable=invalid-name,redefined-outer-name
|
||||
|
||||
ENV_ENABLED = 'ENABLE_API_QUERY'
|
||||
|
||||
CANTEENS = read_canteen_config()
|
||||
|
||||
+8
-3
@@ -1,12 +1,17 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
import pytest
|
||||
|
||||
from response_util import meal_names
|
||||
from stw_potsdam import views
|
||||
|
||||
# noinspection PyUnresolvedReferences
|
||||
from tests.response_util import meal_names
|
||||
# pytest fixtures are linked via parameter names of test methods
|
||||
from stub_api import api_offline, api_online_one_shot
|
||||
# pragma pylint: disable=unused-import,redefined-outer-name,unused-argument
|
||||
from tests.stub_api import api_offline, api_online_one_shot
|
||||
|
||||
# Long test method names are not 'snake case'!
|
||||
# See https://github.com/PyCQA/pylint/issues/2047
|
||||
# The fix has not been ported to Python 2.x.
|
||||
# pylint: disable=invalid-name
|
||||
|
||||
|
||||
def test_health_check(client):
|
||||
|
||||
Reference in New Issue
Block a user