Merge branch 'master' into patch-8

This commit is contained in:
blacktwin 2019-10-04 22:49:02 -04:00 committed by GitHub
commit 64013a32fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 37 additions and 19 deletions

3
.gitignore vendored
View file

@ -18,8 +18,9 @@ config.ini
ipython_config.py
dist
docs/_build/
docs/src/
htmlcov
include/
lib/
pip-selfcheck.json
pyvenv.cfg
pyvenv.cfg

View file

@ -60,8 +60,8 @@ templates_path = ['../']
# You can specify multiple suffix as a list of string:
# source_suffix = ['.rst', '.md']
# source_suffix = '.rst'
source_parsers = {'.md': CommonMarkParser}
source_suffix = ['.rst', '.md']
# source_parsers = {'.md': CommonMarkParser} # deprecated
# source_suffix = ['.rst', '.md'] # deprecated
# The encoding of source files.
# source_encoding = 'utf-8-sig'

View file

@ -14,7 +14,7 @@ CONFIG = PlexConfig(CONFIG_PATH)
# PlexAPI Settings
PROJECT = 'PlexAPI'
VERSION = '3.1.0'
VERSION = '3.2.0'
TIMEOUT = CONFIG.get('plexapi.timeout', 30, int)
X_PLEX_CONTAINER_SIZE = CONFIG.get('plexapi.container_size', 100, int)
X_PLEX_ENABLE_FAST_CONNECT = CONFIG.get('plexapi.enable_fast_connect', False, bool)

View file

@ -44,6 +44,11 @@ try:
except ImportError:
from xml.etree import ElementTree
try:
from unittest.mock import patch, MagicMock
except ImportError:
from mock import patch, MagicMock
def makedirs(name, mode=0o777, exist_ok=False):
""" Mimicks os.makedirs() from Python 3. """

6
pytest.ini Normal file
View file

@ -0,0 +1,6 @@
[pytest]
markers =
client: this is a client test.
req_client: require a client to run this test.
anonymously: test plexapi anonymously.
authenticated: test plexapi authenticated.

View file

@ -4,4 +4,4 @@
#---------------------------------------------------------
requests
tqdm
websocket-client
websocket-client==0.48.0

View file

@ -12,7 +12,12 @@ pytest-mock
recommonmark
requests
sphinx
sphinx-rtd-theme
sphinxcontrib-napoleon
tqdm
websocket-client==0.48.0
# Installing sphinx-rtd-theme directly from github above is used until a point release
# above 0.4.3 is released. https://github.com/readthedocs/sphinx_rtd_theme/issues/739
#sphinx-rtd-theme
-e git+https://github.com/readthedocs/sphinx_rtd_theme.git@feb0beb44a444f875f3369a945e6055965ee993f#egg=sphinx_rtd_theme

View file

@ -1,12 +1,11 @@
# -*- coding: utf-8 -*-
import plexapi
import pytest
import requests
import time
from datetime import datetime
from functools import partial
from os import environ
import pytest
import requests
from plexapi.myplex import MyPlexAccount
try:
@ -14,14 +13,11 @@ try:
except ImportError:
from mock import patch, MagicMock, mock_open
import plexapi
from plexapi import compat
from plexapi.compat import patch, MagicMock
from plexapi.client import PlexClient
from plexapi.server import PlexServer
SERVER_BASEURL = plexapi.CONFIG.get('auth.server_baseurl')
MYPLEX_USERNAME = plexapi.CONFIG.get('auth.myplex_username')
MYPLEX_PASSWORD = plexapi.CONFIG.get('auth.myplex_password')
@ -44,8 +40,6 @@ ENTITLEMENTS = {'ios', 'roku', 'android', 'xbox_one', 'xbox_360', 'windows', 'wi
TEST_AUTHENTICATED = 'authenticated'
TEST_ANONYMOUSLY = 'anonymously'
ANON_PARAM = pytest.param(TEST_ANONYMOUSLY, marks=pytest.mark.anonymous)
AUTH_PARAM = pytest.param(TEST_AUTHENTICATED, marks=pytest.mark.authenticated)
@ -229,7 +223,7 @@ def episode(show):
def photoalbum(photos):
try:
return photos.get('Cats')
except:
except Exception:
return photos.get('photo_album1')
@pytest.fixture()

View file

@ -201,43 +201,49 @@ def test_library_and_section_search_for_movie(plex):
assert l_search == s_search
@pytest.mark.skip(reason="broken test?")
def test_library_Colletion_modeUpdate_hide(collection):
collection.modeUpdate(mode='hide')
collection.reload()
assert collection.collectionMode == '0'
@pytest.mark.skip(reason="broken test?")
def test_library_Colletion_modeUpdate_default(collection):
collection.modeUpdate(mode='default')
collection.reload()
assert collection.collectionMode == '-2'
@pytest.mark.skip(reason="broken test?")
def test_library_Colletion_modeUpdate_hideItems(collection):
collection.modeUpdate(mode='hideItems')
collection.reload()
assert collection.collectionMode == '1'
@pytest.mark.skip(reason="broken test?")
def test_library_Colletion_modeUpdate_showItems(collection):
collection.modeUpdate(mode='showItems')
collection.reload()
assert collection.collectionMode == '2'
@pytest.mark.skip(reason="broken test?")
def test_library_Colletion_sortAlpha(collection):
collection.sortUpdate(sort='alpha')
collection.reload()
assert collection.collectionSort == '1'
@pytest.mark.skip(reason="broken test?")
def test_library_Colletion_sortRelease(collection):
collection.sortUpdate(sort='release')
collection.reload()
assert collection.collectionSort == '0'
# This started failing on more recent Plex Server builds
@pytest.mark.xfail
@pytest.mark.skip(reason="broken test?")
def test_search_with_apostrophe(plex):
show_title = 'Marvel\'s Daredevil'
result_root = plex.search(show_title)

View file

@ -170,6 +170,7 @@ def test_myplex_createExistingUser(account, plex, shared_username):
assert shared_username in [u.username for u in plex.myPlexAccount().users() if u.home is False]
@pytest.mark.skip(reason="broken test?")
def test_myplex_createHomeUser_remove(account, plex):
homeuser = 'New Home User'
account.createHomeUser(homeuser, plex)