Skip to content

Commit

Permalink
PEP8
Browse files Browse the repository at this point in the history
  • Loading branch information
teleyinex committed Jan 5, 2017
1 parent 3695c9d commit a01f7b9
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions test/test_util.py
Expand Up @@ -85,7 +85,8 @@ def test_last_flashed_messages_none(self, mockflash):
@patch('pybossa.util.render_template')
@patch('pybossa.util.jsonify')
@patch('pybossa.util.last_flashed_message')
def test_handle_content_type_json(self, mocklast, mockjsonify, mockrender, mockrequest):
def test_handle_content_type_json(self, mocklast, mockjsonify,
mockrender, mockrequest):
mockrequest.headers.__getitem__.return_value = 'application/json'
mockjsonify.side_effect = myjsonify
res = util.handle_content_type(dict(template='example.html'))
Expand All @@ -99,7 +100,8 @@ def test_handle_content_type_json(self, mocklast, mockjsonify, mockrender, mockr
@patch('pybossa.util.render_template')
@patch('pybossa.util.jsonify')
@patch('pybossa.util.last_flashed_message')
def test_handle_content_type_json_error(self, mocklast, mockjsonify, mockrender, mockrequest):
def test_handle_content_type_json_error(self, mocklast, mockjsonify,
mockrender, mockrequest):
mockrequest.headers.__getitem__.return_value = 'application/json'
mockjsonify.side_effect = myjsonify
res, code = util.handle_content_type(dict(template='example.html', code=404,
Expand All @@ -120,7 +122,9 @@ def test_handle_content_type_json_error(self, mocklast, mockjsonify, mockrender,
@patch('pybossa.util.jsonify')
@patch('pybossa.util.generate_csrf')
@patch('pybossa.util.last_flashed_message')
def test_handle_content_type_json_form(self, mocklast, mockcsrf, mockjsonify, mockrender, mockrequest):
def test_handle_content_type_json_form(self, mocklast, mockcsrf,
mockjsonify, mockrender,
mockrequest):
mockrequest.headers.__getitem__.return_value = 'application/json'
mockjsonify.side_effect = myjsonify
mockcsrf.return_value = "yourcsrf"
Expand All @@ -144,7 +148,8 @@ def test_handle_content_type_json_form(self, mocklast, mockcsrf, mockjsonify, mo
@patch('pybossa.util.render_template')
@patch('pybossa.util.jsonify')
@patch('pybossa.util.last_flashed_message')
def test_handle_content_type_json_pagination(self, mocklast, mockjsonify, mockrender, mockrequest):
def test_handle_content_type_json_pagination(self, mocklast, mockjsonify,
mockrender, mockrequest):
mockrequest.headers.__getitem__.return_value = 'application/json'
mockjsonify.side_effect = myjsonify
pagination = util.Pagination(page=1, per_page=5, total_count=10)
Expand All @@ -162,7 +167,8 @@ def test_handle_content_type_json_pagination(self, mocklast, mockjsonify, mockre
@patch('pybossa.util.request')
@patch('pybossa.util.render_template')
@patch('pybossa.util.jsonify')
def test_handle_content_type_html(self, mockjsonify, mockrender, mockrequest):
def test_handle_content_type_html(self, mockjsonify,
mockrender, mockrequest):
mockrequest.headers.__getitem__.return_value = 'text/html'
mockjsonify.side_effect = myjsonify
mockrender.side_effect = myrender
Expand All @@ -182,7 +188,8 @@ def test_handle_content_type_html(self, mockjsonify, mockrender, mockrequest):
@patch('pybossa.util.request')
@patch('pybossa.util.render_template')
@patch('pybossa.util.jsonify')
def test_handle_content_type_html_error(self, mockjsonify, mockrender, mockrequest):
def test_handle_content_type_html_error(self, mockjsonify,
mockrender, mockrequest):
mockrequest.headers.__getitem__.return_value = 'text/html'
mockjsonify.side_effect = myjsonify
mockrender.side_effect = myrender
Expand Down

0 comments on commit a01f7b9

Please sign in to comment.