Skip to content

Commit

Permalink
Merge pull request #676 from glensc/673-config
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc authored Dec 27, 2021
2 parents 7eee4e8 + 734a44b commit 6f82004
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/mock_data/673-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"sync": {
"trakt_to_plex": {
"watched_status": true,
"ratings": false,
"liked_lists": false,
"watchlist": false
},
"plex_to_trakt": {
"watched_status": true,
"ratings": false,
"collection": false
}
}
}
20 changes: 20 additions & 0 deletions tests/test_config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#!/usr/bin/env python3 -m pytest
from os import environ
from os.path import join

from plextraktsync.config import Config
from plextraktsync.factory import factory
from plextraktsync.sync import SyncConfig


def test_config_merge():
Expand All @@ -23,6 +26,23 @@ def test_config_merge():
assert config["root"]["key2"] == "value2"


def test_config_merge_real():
config = Config()
from tests.conftest import MOCK_DATA_DIR
config.config_file = join(MOCK_DATA_DIR, "673-config.json")

assert config["sync"]["plex_to_trakt"]["collection"] is False


def test_sync_config():
config = Config()
from tests.conftest import MOCK_DATA_DIR
config.config_file = join(MOCK_DATA_DIR, "673-config.json")

sync_config = SyncConfig(config)
assert sync_config.plex_to_trakt["collection"] is False


def test_config():
config = factory.config()

Expand Down

0 comments on commit 6f82004

Please sign in to comment.