diff --git a/tests/mock_data/673-config.json b/tests/mock_data/673-config.json new file mode 100644 index 0000000000..a777989ced --- /dev/null +++ b/tests/mock_data/673-config.json @@ -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 + } + } +} \ No newline at end of file diff --git a/tests/test_config.py b/tests/test_config.py index fe97bab798..c66669ce85 100755 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -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(): @@ -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()