1
0
mirror of https://github.com/spl0k/supysonic.git synced 2024-12-22 17:06:17 +00:00

Update tests

This commit is contained in:
Alban Féron 2019-11-23 15:43:27 +01:00
parent eeeb812c6d
commit 7cb825cedb
No known key found for this signature in database
GPG Key ID: 8CE0313646D16165

View File

@ -120,11 +120,31 @@ class CLITestCase(unittest.TestCase):
def test_user_setadmin(self): def test_user_setadmin(self):
self.__cli.onecmd("user add -p Alic3 alice") self.__cli.onecmd("user add -p Alic3 alice")
self.__cli.onecmd("user setadmin alice") self.__cli.onecmd("user setroles -A alice")
self.__cli.onecmd("user setadmin bob") self.__cli.onecmd("user setroles -A bob")
with db_session: with db_session:
self.assertTrue(User.get(name="alice").admin) self.assertTrue(User.get(name="alice").admin)
def test_user_unsetadmin(self):
self.__cli.onecmd("user add -p Alic3 alice")
self.__cli.onecmd("user setroles -A alice")
self.__cli.onecmd("user setroles -a alice")
with db_session:
self.assertFalse(User.get(name="alice").admin)
def test_user_setjukebox(self):
self.__cli.onecmd("user add -p Alic3 alice")
self.__cli.onecmd("user setroles -J alice")
with db_session:
self.assertTrue(User.get(name="alice").jukebox)
def test_user_unsetjukebox(self):
self.__cli.onecmd("user add -p Alic3 alice")
self.__cli.onecmd("user setroles -J alice")
self.__cli.onecmd("user setroles -j alice")
with db_session:
self.assertFalse(User.get(name="alice").jukebox)
def test_user_changepass(self): def test_user_changepass(self):
self.__cli.onecmd("user add -p Alic3 alice") self.__cli.onecmd("user add -p Alic3 alice")
self.__cli.onecmd("user changepass alice newpass") self.__cli.onecmd("user changepass alice newpass")