Add test for config class
ADD
tests/test_config.py
+#!/usr/bin/env python3 -m pytest
+from os import environ
+
+from plex_trakt_sync.factory import factory
+
+
+def test_config():
+ config = factory.config()
+
+ environ["PLEX_TOKEN"] = "Foo"
+ config.initialized = False
+ assert config["PLEX_TOKEN"] == "Foo"
+
+ try:
+ del environ["PLEX_TOKEN"]
+ except KeyError:
+ pass
+ config.initialized = False
+ assert config["PLEX_TOKEN"] is None
+
+ environ["PLEX_TOKEN"] = "-"
+ config.initialized = False
+ assert config["PLEX_TOKEN"] is None
+
+ environ["PLEX_TOKEN"] = "None"
+ config.initialized = False
+ assert config["PLEX_TOKEN"] is None
+

Add test for config class