Skip to content

Commit 0320b0d

Browse files
committed
add unit tests for setters
1 parent f084acf commit 0320b0d

4 files changed

Lines changed: 57 additions & 0 deletions

File tree

identify/tests/resources/test_attribute.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,23 @@ def test_constructor(self, mocker):
3737
assert data['description'] == tt.description
3838
assert data['dataType'] == tt.data_type
3939

40+
def test_getters_and_setters(self):
41+
'''
42+
'''
43+
attr1 = Attribute({})
44+
attr1.id = 'a'
45+
attr1.traffic_type_id = 'b'
46+
attr1.display_name = 'c'
47+
attr1.description = 'd'
48+
attr1.data_type = 'e'
49+
50+
assert attr1.id == 'a'
51+
assert attr1.traffic_type_id == 'b'
52+
assert attr1.display_name == 'c'
53+
assert attr1.description == 'd'
54+
assert attr1.data_type == 'e'
55+
56+
4057
def test_delete(self, mocker):
4158
'''
4259
'''

identify/tests/resources/test_environment.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ def test_constructor(self, mocker):
3030
from identify.resources.base_resource import BaseResource
3131
BaseResource.__init__.assert_called_once_with(env, '123', client)
3232

33+
def test_getters_and_setters(self):
34+
'''
35+
'''
36+
env1 = Environment({})
37+
env1.id = 'a'
38+
env1.name = 'b'
39+
40+
assert env1.id == 'a'
41+
assert env1.name == 'b'
42+
3343
def test_add_identity(self, mocker):
3444
'''
3545
'''

identify/tests/resources/test_identity.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,24 @@ def test_constructor(self, mocker):
3131
from identify.resources.base_resource import BaseResource
3232
BaseResource.__init__.assert_called_once_with(identity, None, client)
3333

34+
def test_getters_and_setters(self):
35+
'''
36+
'''
37+
identity1 = Identity({})
38+
identity1.id = 'a'
39+
identity1.key = 'b'
40+
identity1.traffic_type_id = 'c'
41+
identity1.environment_id = 'd'
42+
identity1.values = 'e'
43+
identity1.organization_id = 'f'
44+
45+
assert identity1.id == 'a'
46+
assert identity1.key == 'b'
47+
assert identity1.traffic_type_id == 'c'
48+
assert identity1.environment_id == 'd'
49+
assert identity1.values == 'e'
50+
assert identity1.organization_id == 'f'
51+
3452
def test_save(self, mocker):
3553
'''
3654
'''

identify/tests/resources/test_traffic_type.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ def test_constructor(self, mocker):
3232
from identify.resources.base_resource import BaseResource
3333
BaseResource.__init__.assert_called_once_with(tt, '123', client)
3434

35+
def test_getters_and_setters(self):
36+
'''
37+
'''
38+
tt1 = TrafficType({})
39+
tt1.id = 'a'
40+
tt1.name = 'b'
41+
tt1.display_attribute_id = 'c'
42+
43+
assert tt1.id == 'a'
44+
assert tt1.name == 'b'
45+
assert tt1.display_attribute_id == 'c'
46+
3547
def test_fetch_attributes(self, mocker):
3648
'''
3749
'''

0 commit comments

Comments
 (0)