mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Fix all E201 and E202 style errors
using the following command: ``` autopep8 -i -r --exclude $(sed -e 's|^|./|' -e 's|/$||' .ci/flake8_blacklist.txt | paste -sd,) --select E201,E202 . ```
This commit is contained in:
committed by
Nicola Soranzo
parent
008a1d849c
commit
21b44bf348
+14
-14
@@ -3,25 +3,25 @@
|
||||
from base import api
|
||||
|
||||
|
||||
class ApiFrameworkTestCase( api.ApiTestCase ):
|
||||
class ApiFrameworkTestCase(api.ApiTestCase):
|
||||
|
||||
# Next several tests test the API's run_as functionality.
|
||||
def test_user_cannont_run_as( self ):
|
||||
post_data = dict( name="TestHistory1", run_as="another_user" )
|
||||
def test_user_cannont_run_as(self):
|
||||
post_data = dict(name="TestHistory1", run_as="another_user")
|
||||
# Normal user cannot run_as...
|
||||
create_response = self._post( "histories", data=post_data )
|
||||
self._assert_status_code_is( create_response, 403 )
|
||||
create_response = self._post("histories", data=post_data)
|
||||
self._assert_status_code_is(create_response, 403)
|
||||
|
||||
def test_run_as_invalid_user( self ):
|
||||
post_data = dict( name="TestHistory1", run_as="another_user" )
|
||||
def test_run_as_invalid_user(self):
|
||||
post_data = dict(name="TestHistory1", run_as="another_user")
|
||||
# admin user can run_as, but this user doesn't exist, expect 400.
|
||||
create_response = self._post( "histories", data=post_data, admin=True )
|
||||
self._assert_status_code_is( create_response, 400 )
|
||||
create_response = self._post("histories", data=post_data, admin=True)
|
||||
self._assert_status_code_is(create_response, 400)
|
||||
|
||||
def test_run_as_valid_user( self ):
|
||||
run_as_user = self._setup_user( "for_run_as@bx.psu.edu" )
|
||||
post_data = dict( name="TestHistory1", run_as=run_as_user[ "id" ] )
|
||||
def test_run_as_valid_user(self):
|
||||
run_as_user = self._setup_user("for_run_as@bx.psu.edu")
|
||||
post_data = dict(name="TestHistory1", run_as=run_as_user["id"])
|
||||
# Use run_as with admin user and for another user just created, this
|
||||
# should work.
|
||||
create_response = self._post( "histories", data=post_data, admin=True )
|
||||
self._assert_status_code_is( create_response, 200 )
|
||||
create_response = self._post("histories", data=post_data, admin=True)
|
||||
self._assert_status_code_is(create_response, 200)
|
||||
|
||||
Reference in New Issue
Block a user