This repository was archived by the owner on May 5, 2022. It is now read-only.
forked from launchdarkly/python-server-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_integration_ldclient.py
More file actions
51 lines (36 loc) · 1.75 KB
/
Copy pathtest_integration_ldclient.py
File metadata and controls
51 lines (36 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import logging
import sys
import pytest
from ldclient import Config
from ldclient import LDClient
from testing import sdk_key
from testing.sync_util import wait_until
logging.basicConfig(level=logging.DEBUG)
# skipping for Python 2.6 since it is incompatible with LaunchDarkly's streaming connection due to SNI
@pytest.mark.skipif(sdk_key is None or sys.version_info < (2, 7),
reason="Requires Python >=2.7 and LD_SDK_KEY environment variable to be set")
def test_ctor_with_sdk_key():
client = LDClient(sdk_key=sdk_key)
wait_until(client.is_initialized, timeout=10)
client.close()
# skipping for Python 2.6 since it is incompatible with LaunchDarkly's streaming connection due to SNI
@pytest.mark.skipif(sdk_key is None or sys.version_info < (2, 7),
reason="Requires Python >=2.7 and LD_SDK_KEY environment variable to be set")
def test_ctor_with_sdk_key_and_config():
client = LDClient(sdk_key=sdk_key, config=Config.default())
wait_until(client.is_initialized, timeout=10)
client.close()
# skipping for Python 2.6 since it is incompatible with LaunchDarkly's streaming connection due to SNI
@pytest.mark.skipif(sdk_key is None or sys.version_info < (2, 7),
reason="Requires Python >=2.7 and LD_SDK_KEY environment variable to be set")
def test_ctor_with_config():
client = LDClient(config=Config(sdk_key=sdk_key))
wait_until(client.is_initialized, timeout=10)
client.close()
#polling
@pytest.mark.skipif(sdk_key is None,
reason="requires LD_SDK_KEY environment variable to be set")
def test_ctor_with_config_polling():
client = LDClient(config=Config(sdk_key=sdk_key, stream=False))
wait_until(client.is_initialized, timeout=10)
client.close()