def test_param_for_user_with_no_secondary(): expected = int(hashlib.sha1('feature.key.abc.xyz'.encode('utf-8')).hexdigest()[:15], 16) / float(0xFFFFFFFFFFFFFFF) assert util._param_for_user(minimal_feature, {u'key': u'xyz'}) == expected
def test_param_for_user_with_no_secondary(): expected = int( hashlib.sha1('feature.key.abc.xyz'.encode('utf-8')).hexdigest()[:15], 16) / float(0xFFFFFFFFFFFFFFF) assert util._param_for_user(minimal_feature, {u'key': u'xyz'}) == expected
def test_param_for_user_with_no_key(): assert util._param_for_user(minimal_feature, {}) is None