Skip to content

Commit

Permalink
Review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rashidsp committed Aug 17, 2018
1 parent 487b66c commit 28b9a78
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions optimizely/helpers/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

import json
import jsonschema

from six import string_types

from optimizely.user_profile import UserProfile
from . import constants

Expand Down Expand Up @@ -163,7 +163,7 @@ def is_non_empty_string(input_id_key):
Returns:
Boolean depending upon whether input is valid or not.
"""
if isinstance(input_id_key, string_types) and input_id_key:
if input_id_key and isinstance(input_id_key, string_types):
return True

return False
6 changes: 3 additions & 3 deletions tests/helpers_tests/test_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ def test_is_non_empty_string(self):
self.assertFalse(validator.is_non_empty_string(1.2))
self.assertFalse(validator.is_non_empty_string(True))
self.assertFalse(validator.is_non_empty_string(False))
self.assertFalse(validator.is_non_empty_string(""))
self.assertFalse(validator.is_non_empty_string(''))

self.assertTrue(validator.is_non_empty_string("0"))
self.assertTrue(validator.is_non_empty_string("test_user"))
self.assertTrue(validator.is_non_empty_string('0'))
self.assertTrue(validator.is_non_empty_string('test_user'))


class DatafileValidationTests(base.BaseTest):
Expand Down

0 comments on commit 28b9a78

Please sign in to comment.