Renames api.py to session.py

This commit is contained in:
2019-05-20 15:13:30 -05:00
parent 66fddf6159
commit 6f5108ec91
3 changed files with 41 additions and 10 deletions

View File

@@ -1,13 +1,13 @@
# -*- coding: utf-8 -*-
import unittest
from funkwhale import api
from funkwhale import session
class testApi(unittest.TestCase):
def setUp(self):
# For the moment we use the demo Funkwhale server.
# Later the API wrapper should have the possibility of using environment variables to fill the class constructor.
self.session = api.Session()
self.session = session.Session()
def test_auth(self):
""" Testing user authentication against the Funkwhale server. """
@@ -18,7 +18,7 @@ class testApi(unittest.TestCase):
""" Testing the exception mechanism present in all API methods. """
self.setUp()
self.session.username = "demo1"
self.assertRaises(api.APIError, self.session.login)
self.assertRaises(session.APIError, self.session.login)
self.setUp()
self.session.login()