Skip to content

Commit 9053f33

Browse files
committed
test: added test for mac property
1 parent 4342e7d commit 9053f33

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

tests/unit/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
from .test_tion import retryTests
2+
from .test_tion import TionTests

tests/unit/test_tion.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
import unittest.mock as mock
44
import bluepy
55

6+
from tion_btle.tion import tion
7+
from tion_btle.lite import LiteFamily
8+
from tion_btle.lite import Lite
9+
from tion_btle.s3 import S3
10+
from tion_btle.s4 import S4
611
from tion_btle.tion import retry, MaxTriesExceededError
712

813

@@ -135,3 +140,16 @@ def e():
135140

136141
with self.assertRaises(MaxTriesExceededError) as c:
137142
e()
143+
144+
145+
class TionTests(unittest.TestCase):
146+
def setUp(self):
147+
self.instances = [tion, LiteFamily, Lite, S3, S4]
148+
149+
def test_mac(self):
150+
"""mac property should be same as in init"""
151+
target = 'foo'
152+
for s in self.instances:
153+
with self.subTest(test_instance=s):
154+
t_tion = s(target)
155+
self.assertEqual(t_tion.mac, target)

0 commit comments

Comments
 (0)