Skip to content

Commit

Permalink
Merging dev: fix NameError (#31)
Browse files Browse the repository at this point in the history
* version 0.2.7

dev

* .gitignore added (#19)

* Fix NameError (#28)

* Fix NameError

* Fix test definition testEncodeUidSuccess

* Assign ret
  • Loading branch information
PrabhanshuAttri authored Oct 4, 2017
1 parent 6ee3c70 commit 2ee2fe0
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions Tests/test_pybeacon.py
Original file line number Diff line number Diff line change
@@ -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 *


Expand Down Expand Up @@ -52,18 +57,17 @@ 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():
uidToEncode = "test.com"
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)
'''

0 comments on commit 2ee2fe0

Please # to comment.