def test_skips_enabling_for_missing_url(): logger = BaseLogger(MOCK_AGENT) assert logger.enableable is False assert logger.enabled is False assert logger.url is None logger.enable() assert logger.enabled is False
def test_skips_enabling_for_undefined_url(): logger = BaseLogger(MOCK_AGENT, url=None) assert logger.enableable is False assert logger.enabled is False assert logger.url is None logger.enable() assert logger.enabled is False
def test_skips_enabling_for_invalid_urls(): for invalid_url in MOCK_URLS_INVALID: logger = BaseLogger(MOCK_AGENT, url=invalid_url) assert logger.enableable is False assert logger.enabled is False assert logger.url is None logger.enable() assert logger.enabled is False
def test_performs_enabling_when_expected(): logger = BaseLogger(MOCK_AGENT, url=DEMO_URL, enabled=False) assert logger.enableable is True assert logger.enabled is False assert logger.url == DEMO_URL logger.enable() assert logger.enabled is True logger = BaseLogger(MOCK_AGENT, queue=[], enabled=False) assert logger.enableable is True assert logger.enabled is False assert logger.url is None logger.enable().disable().enable() assert logger.enabled is True