Skip to content

Commit ee935bc

Browse files
committed
test(event_dispatcher): update constant with service value
1 parent a386239 commit ee935bc

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

tests/events/test_event_dispatcher.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from vwo.event import event_dispatcher
2020
from ..data.constants import TEST_ACCOUNT_ID
2121
from vwo.constants import constants
22+
from vwo.services.url_manager import url_manager
2223

2324

2425
def flush_callback(err, events):
@@ -100,7 +101,7 @@ def test_dispatch_returns_error_status_code(self):
100101
self.assertIs(result, False)
101102

102103
def test_dispatch_sends_events_impression(self):
103-
url = constants.HTTPS_PROTOCOL + constants.ENDPOINTS.BASE_URL + constants.ENDPOINTS.EVENTS
104+
url = constants.HTTPS_PROTOCOL + url_manager.get_base_url() + constants.ENDPOINTS.EVENTS
104105
with mock.patch(
105106
"vwo.http.connection.Connection.post", return_value={"status_code": 200, "text": ""}
106107
) as mock_connection_get:

tests/services/test_url_manager.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
class UrlManagerTest(unittest.TestCase):
2121
def test_url_manager_get_base_url(self):
22+
url_manager.set_config()
2223
self.assertEquals(url_manager.get_base_url(), constants.ENDPOINTS.BASE_URL)
2324

2425
def test_url_manager_get_base_url_with_prefix(self):

vwo/services/url_manager.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def set_config(self, config={}):
3737
"""
3838

3939
self.config = config
40+
self.collection_prefix = None
4041

4142
collection_prefix_value = config.get("collection_prefix")
4243
if collection_prefix_value and validate_util.is_valid_string(collection_prefix_value):

0 commit comments

Comments
 (0)