Skip to content

Commit

Permalink
Changed event value test names to event tags. Updated test comment de…
Browse files Browse the repository at this point in the history
…scriptions.
  • Loading branch information
alda-optimizely committed Sep 7, 2017
1 parent aaf3d9c commit e8ff99d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
16 changes: 8 additions & 8 deletions tests/test_event_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@ def test_create_conversion_event__with_attributes_no_match(self):
event_builder.EventBuilder.HTTP_VERB,
event_builder.EventBuilder.HTTP_HEADERS)

def test_create_conversion_event__with_event_value(self):
def test_create_conversion_event__with_event_tags(self):
""" Test that create_conversion_event creates Event object
with right params when event value is provided. """
with right params when event tags provided. """

expected_params = {
'accountId': '12001',
Expand Down Expand Up @@ -269,9 +269,9 @@ def test_create_conversion_event__with_event_value(self):
event_builder.EventBuilder.HTTP_VERB,
event_builder.EventBuilder.HTTP_HEADERS)

def test_create_conversion_event__with_invalid_event_value(self):
def test_create_conversion_event__with_invalid_event_tags(self):
""" Test that create_conversion_event creates Event object
with right params when event value is provided. """
with right params when invalid event tags are provided. """

expected_params = {
'accountId': '12001',
Expand Down Expand Up @@ -477,9 +477,9 @@ def test_create_conversion_event__with_attributes(self):
event_builder.EventBuilderV3.HTTP_VERB,
event_builder.EventBuilderV3.HTTP_HEADERS)

def test_create_conversion_event__with_event_value(self):
def test_create_conversion_event__with_event_tags(self):
""" Test that create_conversion_event creates Event object
with right params when event value and tags are provided. """
with right params when event tags are provided. """

expected_params = {
'client_version': version.__version__,
Expand Down Expand Up @@ -530,9 +530,9 @@ def test_create_conversion_event__with_event_value(self):
event_builder.EventBuilderV3.HTTP_VERB,
event_builder.EventBuilderV3.HTTP_HEADERS)

def test_create_conversion_event__with_invalid_event_value(self):
def test_create_conversion_event__with_invalid_event_tags(self):
""" Test that create_conversion_event creates Event object
with right params when event value is provided. """
with right params when event tags are provided. """

expected_params = {
'client_version': version.__version__,
Expand Down
11 changes: 5 additions & 6 deletions tests/test_optimizely.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,8 @@ def test_track__with_attributes__invalid_attributes(self):
self.assertEqual(0, mock_bucket.call_count)
self.assertEqual(0, mock_dispatch_event.call_count)

def test_track__with_event_value(self):
""" Test that track calls dispatch_event with right params when event_value information is provided. """
def test_track__with_event_tags(self):
""" Test that track calls dispatch_event with right params when event tags are provided. """

with mock.patch('optimizely.decision_service.DecisionService.get_variation',
return_value=self.project_config.get_variation_from_id(
Expand Down Expand Up @@ -448,7 +448,7 @@ def test_track__with_event_value(self):
self._validate_event_object(mock_dispatch_event.call_args[0][0], 'https://logx.optimizely.com/log/event',
expected_params, 'POST', {'Content-Type': 'application/json'})

def test_track__with_event_value__forced_bucketing(self):
def test_track__with_event_tags__forced_bucketing(self):
""" Test that track calls dispatch_event with right params when event_value information is provided
after a forced bucket. """

Expand Down Expand Up @@ -577,10 +577,9 @@ def test_track__with_deprecated_event_value(self):
self._validate_event_object(mock_dispatch_event.call_args[0][0], 'https://logx.optimizely.com/log/event',
expected_params, 'POST', {'Content-Type': 'application/json'})

def test_track__with_invalid_event_value(self):
""" Test that track calls dispatch_event with right params when event_value information is provided. """
def test_track__with_invalid_event_tags(self):
""" Test that track calls dispatch_event with right params when invalid event tags are provided. """

self.maxDiff = None
with mock.patch('optimizely.decision_service.DecisionService.get_variation',
return_value=self.project_config.get_variation_from_id(
'test_experiment', '111128'
Expand Down

0 comments on commit e8ff99d

Please sign in to comment.