Skip to content

Commit

Permalink
testcase fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
uzair-folio3 committed Sep 17, 2020
1 parent 09533b1 commit ad17c02
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions optimizely/helpers/condition.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,7 @@ def compare_user_version_with_target_version(self, target_version, user_version)
return -1

# check if user version contains build or pre-release and target version doesn't
if (is_pre_release_in_user_version and not is_pre_release_in_target_version) or \
(is_build_in_user_version and not is_build_in_target_version):
if is_pre_release_in_user_version and is_build_in_target_version:
return -1
return 0

Expand Down
5 changes: 2 additions & 3 deletions tests/helpers_tests/test_condition.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ def test_compare_user_version_with_target_version_equal_to_0(self):
('2.9.9-beta', '2.9.9-beta'),
('2.1', '2.1.0'),
('2', '2.12'),
('2.9', '2.9.1')
('2.9', '2.9.1'),
('2.9.1', '2.9.1+beta')
]
for target_version, user_version in versions:
evaluator = condition_helper.CustomAttributeConditionEvaluator(
Expand Down Expand Up @@ -285,8 +286,6 @@ def test_compare_user_version_with_target_version_less_than_0(self):
('2.3.5', '2.3.1'),
('2.9.8', '2.9'),
('2.1.2-release', '2.1.2-beta'),
('2.1.3', '2.1.3-beta'),
('2.1.3', '2.1.3+beta'),
('2.9.9+beta', '2.9.9-beta'),
('3.7.0+build3.7.0-prerelease+build', '3.7.0-prerelease'),
('2.1.3-beta-beta2', '2.1.3-beta'),
Expand Down

0 comments on commit ad17c02

Please sign in to comment.