Skip to content

Commit

Permalink
removed python 2 style form test and demo folders
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszsocha2 committed Dec 14, 2021
1 parent d68b7e1 commit 13b21b9
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion demo/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
def authenticate(oauth_class=OAuth2):
class StoppableWSGIServer(bottle.ServerAdapter):
def __init__(self, *args, **kwargs):
super(StoppableWSGIServer, self).__init__(*args, **kwargs)
super().__init__(*args, **kwargs)
self._server = None

def run(self, app):
Expand Down
3 changes: 2 additions & 1 deletion demo/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from boxsdk import Client
from boxsdk.exception import BoxAPIException
from boxsdk.object.collaboration import CollaborationRole
from auth import authenticate
from demo.auth import authenticate


def run_user_example(client):
Expand Down Expand Up @@ -294,5 +294,6 @@ def main():
run_examples(oauth)
os._exit(0)


if __name__ == '__main__':
main()
4 changes: 2 additions & 2 deletions demo/music_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from demo.auth import authenticate


class MusicPlayer(object):
class MusicPlayer:
def __init__(self, folder_path):
self._folder_path = folder_path
self._client = self._get_client()
Expand All @@ -31,7 +31,7 @@ def play(self):
temp_file = tempfile.NamedTemporaryFile()
temp_file.write(item.content())
item_with_name = item.get()
print item_with_name.name
print(item_with_name.name)
subprocess.check_call(['afplay', temp_file.name])


Expand Down
2 changes: 1 addition & 1 deletion test/functional/mock_box/behavior/event_behavior.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from test.functional.mock_box.util import json_utils as json


class EventBehavior(object):
class EventBehavior:
def __init__(self, db_session):
self._db_session = db_session
self._subscribe_event = Event()
Expand Down
2 changes: 1 addition & 1 deletion test/functional/mock_box/behavior/item_behavior.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from test.functional.mock_box.util import json_utils as json


class ItemBehavior(object):
class ItemBehavior:
def __init__(self, db_session):
self._db_session = db_session

Expand Down
2 changes: 1 addition & 1 deletion test/functional/mock_box/behavior/oauth2_behavior.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from test.functional.mock_box.util.http_utils import abort


class OAuth2Behavior(object):
class OAuth2Behavior:
ACCESS_TOKEN_DURATION_SECONDS = 3600
REFRESH_TOKEN_DURATION_DAYS = 60
AUTH_CODE_DURATION_SECONDS = 30
Expand Down
2 changes: 1 addition & 1 deletion test/functional/mock_box/behavior/user_behavior.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from test.functional.mock_box.util.http_utils import abort


class UserBehavior(object):
class UserBehavior:
def __init__(self, db_session):
self._db_session = db_session

Expand Down
2 changes: 1 addition & 1 deletion test/functional/mock_box/box.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
TEMPLATE_PATH.insert(0, join(dirname(__file__), 'views'))


class Box(object):
class Box:
"""
Fake Box. Sets up 4 webservers - one for auth, one for upload, one for events, and one for the rest of the api.
"""
Expand Down
2 changes: 1 addition & 1 deletion test/functional/mock_box/util/http_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class StoppableWSGIRefServer(ServerAdapter):
This is important for testing, since we don't want to "serve forever".
"""
def __init__(self, host='127.0.0.1', port=8080, **options):
super(StoppableWSGIRefServer, self).__init__(host, port, **options)
super().__init__(host, port, **options)
self.srv = None
self._thread = None

Expand Down
2 changes: 1 addition & 1 deletion test/functional/mock_box/util/json_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def default(self, o):
if isinstance(o, FileModel):
del fields['content']
return fields
return super(BoxObjectSerializer, self).default(o)
return super().default(o)

return BoxObjectSerializer

Expand Down
6 changes: 3 additions & 3 deletions test/unit/util/test_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ class Class2:

class Meta(type):
@classmethod
def __prepare__(metacls, name, this_bases, **kwds): # pylint:disable=unused-argument
def __prepare__(mcs, name, this_bases, **kwds): # pylint:disable=unused-argument
assert this_bases == bases
return {}

def __new__(metacls, name, this_bases, namespace, **kwds):
def __new__(mcs, name, this_bases, namespace, **kwds):
assert this_bases == bases
return super(Meta, metacls).__new__(metacls, name, this_bases, namespace, **kwds)
return super(Meta, mcs).__new__(mcs, name, this_bases, namespace, **kwds)

temporary_class = with_metaclass(Meta, *bases)
assert isinstance(temporary_class, Meta)
Expand Down

0 comments on commit 13b21b9

Please sign in to comment.