File tree Expand file tree Collapse file tree 3 files changed +10
-13
lines changed Expand file tree Collapse file tree 3 files changed +10
-13
lines changed Original file line number Diff line number Diff line change 1
1
# ---
2
- import os
3
2
import logging
3
+ import os
4
4
import sys
5
5
import time
6
6
16
16
root .addHandler (handler )
17
17
# ---
18
18
19
- api_url = os .getenv ('UNLEASH_API_URL' , 'https://app.unleash-hosted.com/demo/api' )
20
- api_token = os .getenv ('UNLEASH_API_TOKEN' , 'demo-app:dev.9fc74dd72d2b88bea5253c04240b21a54841f08d9918046ed55a06b5' )
19
+ api_url = os .getenv ("UNLEASH_API_URL" , "https://app.unleash-hosted.com/demo/api" )
20
+ api_token = os .getenv (
21
+ "UNLEASH_API_TOKEN" ,
22
+ "demo-app:dev.9fc74dd72d2b88bea5253c04240b21a54841f08d9918046ed55a06b5" ,
23
+ )
21
24
flag = "example-flag"
22
25
use_streaming = os .getenv ("USE_STREAMING" , "true" ).lower () == "true"
23
26
24
27
client = UnleashClient (
25
28
url = api_url ,
26
29
app_name = "integration-python" ,
27
- custom_headers = {' Authorization' : api_token },
30
+ custom_headers = {" Authorization" : api_token },
28
31
experimental_mode = {"type" : "streaming" } if use_streaming else None ,
29
- metrics_interval = 1 )
32
+ metrics_interval = 1 ,
33
+ )
30
34
31
35
client .initialize_client ()
32
36
Original file line number Diff line number Diff line change 1
1
from __future__ import annotations
2
2
3
- import json
4
-
5
- import pytest
6
-
7
3
from UnleashClient .streaming .event_processor import StreamingEventProcessor
8
4
9
5
Original file line number Diff line number Diff line change 1
1
from __future__ import annotations
2
2
3
- import json
4
3
import threading
5
4
import time
6
5
from typing import Iterable
7
- from unittest .mock import MagicMock , patch
8
-
9
- import pytest
10
6
11
7
from UnleashClient .streaming import StreamingConnector
12
8
from UnleashClient .streaming .event_processor import StreamingEventProcessor
@@ -63,6 +59,7 @@ def close(self):
63
59
def interrupt (self ):
64
60
self .close ()
65
61
62
+
66
63
def test_successful_connection_calls_ready ():
67
64
engine = FakeEngine ()
68
65
processor = StreamingEventProcessor (engine )
You can’t perform that action at this time.
0 commit comments