2017-10-25 21:09:08 +00:00
|
|
|
def test_settings_group(plex):
|
2020-04-29 21:23:22 +00:00
|
|
|
assert plex.settings.group("general")
|
2017-10-25 21:09:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_settings_get(plex):
|
|
|
|
# This is the value since it we havnt set any friendlyname
|
|
|
|
# plex just default to computer name but it NOT in the settings.
|
2020-04-14 20:13:30 +00:00
|
|
|
# check this one. why is this bytes instead of string.
|
2020-04-29 21:23:22 +00:00
|
|
|
value = plex.settings.get("FriendlyName").value
|
2020-04-15 23:12:17 +00:00
|
|
|
# Should not be bytes, fix this when py2 is dropped
|
|
|
|
assert isinstance(value, bytes)
|
2017-10-25 21:09:08 +00:00
|
|
|
|
|
|
|
|
2018-09-14 18:03:23 +00:00
|
|
|
def test_settings_set(plex):
|
2020-04-29 21:23:22 +00:00
|
|
|
cd = plex.settings.get("autoEmptyTrash")
|
2018-09-14 18:03:23 +00:00
|
|
|
old_value = cd.value
|
|
|
|
new_value = not old_value
|
|
|
|
cd.set(new_value)
|
2017-10-25 21:09:08 +00:00
|
|
|
plex.settings.save()
|
2018-09-14 18:03:23 +00:00
|
|
|
plex._settings = None
|
2020-04-29 21:23:22 +00:00
|
|
|
assert plex.settings.get("autoEmptyTrash").value == new_value
|
2018-11-17 19:42:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_settings_set_str(plex):
|
2020-04-29 21:23:22 +00:00
|
|
|
cd = plex.settings.get("OnDeckWindow")
|
2018-11-17 19:42:03 +00:00
|
|
|
new_value = 99
|
|
|
|
cd.set(new_value)
|
|
|
|
plex.settings.save()
|
|
|
|
plex._settings = None
|
2020-04-29 21:23:22 +00:00
|
|
|
assert plex.settings.get("OnDeckWindow").value == 99
|