From 2ee2fe0d2723afd8531a1f75b66c0419a265b2ed Mon Sep 17 00:00:00 2001 From: Prabhanshu Attri Date: Thu, 5 Oct 2017 00:38:59 +0530 Subject: [PATCH] Merging dev: fix NameError (#31) * version 0.2.7 dev * .gitignore added (#19) * Fix NameError (#28) * Fix NameError * Fix test definition testEncodeUidSuccess * Assign ret --- Tests/test_pybeacon.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Tests/test_pybeacon.py b/Tests/test_pybeacon.py index 668204e..6d9ac27 100644 --- a/Tests/test_pybeacon.py +++ b/Tests/test_pybeacon.py @@ -1,4 +1,9 @@ +import os +import sys + import pytest +# Following is a hacky way to ensure relative imports work proplerly. +sys.path.append(os.path.join(os.path.dirname(__file__), '..',)) from PyBeacon.PyBeacon import * @@ -52,13 +57,13 @@ def testDecodeUrlSuccess(): ] assert decodeUrl(dataToDecode) == url -''' -ToDo: Fix the following error -NameError: global name 'encodeUid' is not defined - def testEncodeUidSuccess(): uidToEncode = "EDD1EBEAC04E5DEFA0170BDB87539B67" - ret = [] + ret = [ + 237, 209, 235, 234, 192, 78, 93, 239, + 160, 23, 11, 219, 135, 83, 155, 103, + 0, 0 + ] assert encodeUid(uidToEncode) == ret def testEncodeUidRaisesException(): @@ -66,4 +71,3 @@ def testEncodeUidRaisesException(): with pytest.raises(ValueError) as excinfo: encodeUid(uidToEncode) assert 'Invalid uid. Please specify a valid 16-byte (e.g 32 hex digits) hex string' in str(excinfo.value) -'''