Skip to content

Commit

Permalink
pep
Browse files Browse the repository at this point in the history
  • Loading branch information
Logan Riggs committed Mar 3, 2022
1 parent 240db7c commit e439225
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tabpy/tabpy_server/app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def run(self):
raise RuntimeError(msg)

settings = {}
if self.settings[SettingsParameters.GzipEnabled] == True:
if self.settings[SettingsParameters.GzipEnabled] is True:
settings["decompress_request"] = True
application.listen(
self.settings[SettingsParameters.Port],
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/integ_test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def _get_url(self) -> str:
url = "http://"
url += "localhost:" + self._get_port()
return url

def _get_connection(self) -> http.client.HTTPConnection:
protocol = self._get_transfer_protocol()
url = "localhost:" + self._get_port()
Expand Down
7 changes: 5 additions & 2 deletions tests/integration/test_gzip.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import os
import requests


class TestEvaluate(integ_test_base.IntegTestBase):
def _get_config_file_name(self) -> str:
"""
Expand Down Expand Up @@ -70,7 +71,8 @@ def test_single_value_returned(self):
}

url = self._get_url() + "/evaluate"
response = requests.request("POST", url, data=gzip.compress(payload.encode('utf-8')), headers=headers)
response = requests.request("POST", url, data=gzip.compress(payload.encode('utf-8')),
headers=headers)
result = json.loads(response.text)

self.assertEqual(200, response.status_code)
Expand All @@ -90,7 +92,8 @@ def test_syntax_error(self):
}

url = self._get_url() + "/evaluate"
response = requests.request("POST", url, data=gzip.compress(payload.encode('utf-8')), headers=headers)
response = requests.request("POST", url, data=gzip.compress(payload.encode('utf-8')),
headers=headers)
result = json.loads(response.text)

self.assertEqual(500, response.status_code)
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/server_tests/test_service_info_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ def test_given_server_with_auth_expect_correct_info_response(self):
features = v1["features"]
self.assertDictEqual(
{"authentication": {"methods": {"basic-auth": {}}, "required": True},
'evaluate_enabled': True, 'gzip_enabled': True},
features,
'evaluate_enabled': True, 'gzip_enabled': True},
features,
)


Expand Down

0 comments on commit e439225

Please sign in to comment.