Skip to content

Commit

Permalink
Fixes linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanbc committed Feb 21, 2024
1 parent 8d97c64 commit d908824
Showing 1 changed file with 35 additions and 4 deletions.
39 changes: 35 additions & 4 deletions test_plexorcist.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def test_set_older_than(self):
plexorcist = Plexorcist()
plexorcist.config_file = MagicMock()
plexorcist.config_file.get.return_value = "1d"
# pylint: disable=protected-access
older_than = plexorcist._set_older_than()

# Assertions
Expand All @@ -35,7 +36,13 @@ def test_convert_to_library_ids(self, mock_make_request):

# Prepare test data
mock_response = MagicMock()
mock_response.content = b'<?xml version="1.0" encoding="UTF-8"?><MediaContainer><Directory title="Cinema" key="1"></Directory><Directory title="Series" key="2"></Directory></MediaContainer>'
mock_response.content = (
b'<?xml version="1.0" encoding="UTF-8"?>'
b"<MediaContainer>"
b'<Directory title="Cinema" key="1"></Directory>'
b'<Directory title="Series" key="2"></Directory>'
b"</MediaContainer>"
)
mock_make_request.return_value = mock_response

# Test convert_to_library_ids method
Expand All @@ -56,7 +63,13 @@ def test_get_available_libraries(self, mock_make_request):

# Prepare test data
mock_response = MagicMock()
mock_response.content = b'<?xml version="1.0" encoding="UTF-8"?><MediaContainer><Directory title="Cinema"></Directory><Directory title="Series"></Directory></MediaContainer>'
mock_response.content = (
b'<?xml version="1.0" encoding="UTF-8"?>'
b"<MediaContainer>"
b'<Directory title="Cinema"></Directory>'
b'<Directory title="Series"></Directory>'
b"</MediaContainer>"
)
mock_make_request.return_value = mock_response

# Test get_available_libraries method
Expand Down Expand Up @@ -123,7 +136,16 @@ def test_handle_videos(self, mock_make_request):

# Prepare test data
mock_response = MagicMock()
mock_response.content = b'<?xml version="1.0" encoding="UTF-8"?><MediaContainer viewGroup="show"><Video key="12345" viewCount="1" lastViewedAt="123" grandparentTitle="Grandparent" title="Title"><Media><Part size="1024"/></Media></Video></MediaContainer>'
mock_response.content = (
b'<?xml version="1.0" encoding="UTF-8"?>'
b'<MediaContainer viewGroup="show">'
b'<Video key="1" viewCount="1" lastViewedAt="1" grandparentTitle="GPT" title="Title">'
b"<Media>"
b'<Part size="1024"/>'
b"</Media>"
b"</Video>"
b"</MediaContainer>"
)
mock_make_request.return_value = mock_response

# Test handle_videos method
Expand Down Expand Up @@ -213,7 +235,16 @@ def test_delete_videos(self, mock_make_request):

# Prepare test data
mock_response = MagicMock()
mock_response.content = b'<?xml version="1.0" encoding="UTF-8"?><MediaContainer viewGroup="show"><Video viewCount="1" lastViewedAt="123" grandparentTitle="Grandparent" title="Title"><Media><Part size="1024"/></Media></Video></MediaContainer>'
mock_response.content = (
b'<?xml version="1.0" encoding="UTF-8"?>'
b'<MediaContainer viewGroup="show">'
b'<Video viewCount="1" lastViewedAt="123" grandparentTitle="Grandparent" title="Title">'
b"<Media>"
b'<Part size="1024"/>'
b"</Media>"
b"</Video>"
b"</MediaContainer>"
)
mock_make_request.return_value = mock_response
watched_videos = [
{
Expand Down

0 comments on commit d908824

Please sign in to comment.