anb-python-components 1.2.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- anb_python_components/__init__.py +1 -0
- anb_python_components/classes/__init__.py +1 -0
- anb_python_components/classes/action_state.py +211 -0
- anb_python_components/classes/directory.py +115 -0
- anb_python_components/classes/file.py +226 -0
- anb_python_components/classes/shortcode_parser.py +195 -0
- anb_python_components/custom_types/__init__.py +3 -0
- anb_python_components/custom_types/guid.py +169 -0
- anb_python_components/custom_types/object_array.py +625 -0
- anb_python_components/custom_types/shortcode_attributes.py +128 -0
- anb_python_components/custom_types/two_dim_size.py +413 -0
- anb_python_components/custom_types/version_info.py +461 -0
- anb_python_components/enums/__init__.py +1 -0
- anb_python_components/enums/message_type.py +44 -0
- anb_python_components/enums/not_bool_action.py +24 -0
- anb_python_components/enums/type_copy_strategy.py +47 -0
- anb_python_components/exceptions/__init__.py +1 -0
- anb_python_components/exceptions/wrong_type_exception.py +20 -0
- anb_python_components/extensions/__init__.py +1 -0
- anb_python_components/extensions/array_extension.py +34 -0
- anb_python_components/extensions/bool_extension.py +87 -0
- anb_python_components/extensions/string_extension.py +259 -0
- anb_python_components/extensions/string_extension_constant.py +80 -0
- anb_python_components/extensions/type_extension.py +112 -0
- anb_python_components/models/__init__.py +1 -0
- anb_python_components/models/action_state_message.py +27 -0
- anb_python_components/models/shortcode_model.py +31 -0
- anb_python_components-1.2.1.dist-info/METADATA +12 -0
- anb_python_components-1.2.1.dist-info/RECORD +48 -0
- anb_python_components-1.2.1.dist-info/WHEEL +5 -0
- anb_python_components-1.2.1.dist-info/licenses/LICENSE +235 -0
- anb_python_components-1.2.1.dist-info/top_level.txt +2 -0
- tests/__init__.py +1 -0
- tests/classes/__init__.py +1 -0
- tests/classes/action_state_test.py +138 -0
- tests/classes/directory_test.py +19 -0
- tests/classes/file_test.py +79 -0
- tests/classes/shortcode_parser_test.py +105 -0
- tests/custom_types/__init__.py +1 -0
- tests/custom_types/guid_test.py +14 -0
- tests/custom_types/object_array_test.py +160 -0
- tests/custom_types/two_dim_size_test.py +37 -0
- tests/custom_types/version_info_test.py +51 -0
- tests/extensions/__init__.py +1 -0
- tests/extensions/array_extension_test.py +21 -0
- tests/extensions/bool_extension_test.py +19 -0
- tests/extensions/string_extension_test.py +55 -0
- tests/extensions/type_extension_test.py +38 -0
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# tests/custom_types/object_array_test.py
|
|
2
|
+
|
|
3
|
+
import unittest
|
|
4
|
+
|
|
5
|
+
from anb_python_components.custom_types.object_array import ObjectArray
|
|
6
|
+
|
|
7
|
+
class TestClass:
|
|
8
|
+
def __init__ (self, key, value):
|
|
9
|
+
self.key = key
|
|
10
|
+
self.value = value
|
|
11
|
+
|
|
12
|
+
class ObjectArrayTest(unittest.TestCase):
|
|
13
|
+
def test_init (self):
|
|
14
|
+
array = ObjectArray[int]([1, 2, 3])
|
|
15
|
+
|
|
16
|
+
self.assertEqual(3, len(array))
|
|
17
|
+
|
|
18
|
+
@staticmethod
|
|
19
|
+
def _create_array () -> ObjectArray[int]:
|
|
20
|
+
return ObjectArray[int]([1, 2, 3])
|
|
21
|
+
|
|
22
|
+
def test_get (self):
|
|
23
|
+
array = self._create_array()
|
|
24
|
+
|
|
25
|
+
item = array[0]
|
|
26
|
+
|
|
27
|
+
self.assertEqual(1, item)
|
|
28
|
+
|
|
29
|
+
def test_set (self):
|
|
30
|
+
array = self._create_array()
|
|
31
|
+
|
|
32
|
+
array[0] = 4
|
|
33
|
+
|
|
34
|
+
self.assertEqual(4, array[0])
|
|
35
|
+
|
|
36
|
+
def test_add (self):
|
|
37
|
+
array = self._create_array()
|
|
38
|
+
array.add(4)
|
|
39
|
+
|
|
40
|
+
self.assertEqual(4, array[3])
|
|
41
|
+
|
|
42
|
+
def test_add_range (self):
|
|
43
|
+
array = self._create_array()
|
|
44
|
+
|
|
45
|
+
array.add_range([4, 5, 6])
|
|
46
|
+
|
|
47
|
+
self.assertEqual(4, array[3])
|
|
48
|
+
self.assertEqual(6, len(array))
|
|
49
|
+
|
|
50
|
+
def test_to_array (self):
|
|
51
|
+
array = self._create_array()
|
|
52
|
+
|
|
53
|
+
self.assertEqual([1, 2, 3], array.to_array())
|
|
54
|
+
|
|
55
|
+
def test_find (self):
|
|
56
|
+
array = self._create_array()
|
|
57
|
+
|
|
58
|
+
self.assertEqual(3, array.find(3))
|
|
59
|
+
|
|
60
|
+
def test_sort (self):
|
|
61
|
+
array = ObjectArray[TestClass]([TestClass(1, 3), TestClass(3, 2), TestClass(2, 1)])
|
|
62
|
+
array.sort('key')
|
|
63
|
+
|
|
64
|
+
self.assertEqual(2, array[1].key)
|
|
65
|
+
|
|
66
|
+
def test_sort_callback (self):
|
|
67
|
+
array = self._create_array()
|
|
68
|
+
|
|
69
|
+
array.sort_callback(lambda a: a, True)
|
|
70
|
+
|
|
71
|
+
self.assertEqual(3, array[0])
|
|
72
|
+
|
|
73
|
+
def test_count (self):
|
|
74
|
+
array = self._create_array()
|
|
75
|
+
|
|
76
|
+
self.assertEqual(1, array.count(lambda a: a == 1))
|
|
77
|
+
|
|
78
|
+
def test_is_exists (self):
|
|
79
|
+
array = self._create_array()
|
|
80
|
+
|
|
81
|
+
self.assertTrue(array.is_exists(lambda a: a == 3))
|
|
82
|
+
self.assertFalse(array.is_exists(lambda a: a == 4))
|
|
83
|
+
|
|
84
|
+
def test_min_max (self):
|
|
85
|
+
array = self._create_array()
|
|
86
|
+
|
|
87
|
+
self.assertEqual(1, array.min(lambda a: a))
|
|
88
|
+
self.assertEqual(3, array.max(lambda a: a))
|
|
89
|
+
|
|
90
|
+
def test_get_rows (self):
|
|
91
|
+
array = self._create_array()
|
|
92
|
+
|
|
93
|
+
self.assertEqual(2, len(array.get_rows(lambda a: a != 2)))
|
|
94
|
+
self.assertEqual(3, len(array.get_rows()))
|
|
95
|
+
|
|
96
|
+
def test_get_row (self):
|
|
97
|
+
array = self._create_array()
|
|
98
|
+
|
|
99
|
+
self.assertEqual(3, array.get_row(lambda a: a == 3))
|
|
100
|
+
|
|
101
|
+
def test_where (self):
|
|
102
|
+
array = self._create_array()
|
|
103
|
+
|
|
104
|
+
self.assertEqual(3, array.where(lambda a: a == 3))
|
|
105
|
+
self.assertEqual(None, array.where(lambda a: a == 4))
|
|
106
|
+
self.assertEqual(2, len(array.where(lambda a: a != 2)))
|
|
107
|
+
|
|
108
|
+
def test_get_column (self):
|
|
109
|
+
array = ObjectArray[TestClass]([TestClass(1, 3), TestClass(3, 2), TestClass(2, 1)])
|
|
110
|
+
|
|
111
|
+
get_column1 = array.get_column('key')
|
|
112
|
+
get_column2 = array.get_column('key', lambda a: a.key != 3)
|
|
113
|
+
|
|
114
|
+
self.assertEqual([1, 3, 2], get_column1.to_array())
|
|
115
|
+
self.assertEqual([1, 2], get_column2.to_array())
|
|
116
|
+
|
|
117
|
+
def test_get_column_callback (self):
|
|
118
|
+
array = ObjectArray[TestClass]([TestClass(1, 3), TestClass(3, 2), TestClass(2, 1)])
|
|
119
|
+
|
|
120
|
+
get_column_callback = array.get_column_callback(lambda a: a.value, lambda a: a.key != 3)
|
|
121
|
+
|
|
122
|
+
self.assertEqual([3, 1], get_column_callback.to_array())
|
|
123
|
+
|
|
124
|
+
def test_get_value (self):
|
|
125
|
+
array = ObjectArray[TestClass]([TestClass(1, 3), TestClass(3, 2), TestClass(2, 1)])
|
|
126
|
+
|
|
127
|
+
self.assertEqual(2, array.get_value('value', lambda a: a.key == 3))
|
|
128
|
+
|
|
129
|
+
def test_delete (self):
|
|
130
|
+
array = self._create_array()
|
|
131
|
+
|
|
132
|
+
array.delete(lambda a: a == 2)
|
|
133
|
+
self.assertEqual(2, len(array))
|
|
134
|
+
|
|
135
|
+
array.delete()
|
|
136
|
+
self.assertEqual(0, len(array))
|
|
137
|
+
|
|
138
|
+
def test_first_and_last (self):
|
|
139
|
+
array = self._create_array()
|
|
140
|
+
|
|
141
|
+
self.assertEqual(1, array.first(0))
|
|
142
|
+
self.assertEqual(3, array.last(0))
|
|
143
|
+
|
|
144
|
+
def test_skip (self):
|
|
145
|
+
array = self._create_array()
|
|
146
|
+
|
|
147
|
+
self.assertEqual([2, 3], array.skip(1).to_array())
|
|
148
|
+
|
|
149
|
+
def test_take (self):
|
|
150
|
+
array = self._create_array()
|
|
151
|
+
|
|
152
|
+
self.assertEqual([1, 2], array.take(2).to_array())
|
|
153
|
+
|
|
154
|
+
def test_skip_and_take (self):
|
|
155
|
+
array = self._create_array()
|
|
156
|
+
|
|
157
|
+
self.assertEqual([2], array.skip(1).take(1).to_array())
|
|
158
|
+
|
|
159
|
+
if __name__ == '__main__':
|
|
160
|
+
unittest.main()
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# tests/custom_types/two_dim_size_test.py
|
|
2
|
+
|
|
3
|
+
import unittest
|
|
4
|
+
|
|
5
|
+
from anb_python_components.custom_types.two_dim_size import TwoDimSize
|
|
6
|
+
|
|
7
|
+
class TwoDimSizeTest(unittest.TestCase):
|
|
8
|
+
def test_init (self):
|
|
9
|
+
size = TwoDimSize(1, 2)
|
|
10
|
+
|
|
11
|
+
self.assertEqual(size.width, 1)
|
|
12
|
+
self.assertEqual(size.height, 2)
|
|
13
|
+
|
|
14
|
+
size = TwoDimSize(1, 5, 3, max_height = 4)
|
|
15
|
+
self.assertEqual(size.width, 3)
|
|
16
|
+
self.assertEqual(size.height, 4)
|
|
17
|
+
|
|
18
|
+
def test_math (self):
|
|
19
|
+
size_1 = TwoDimSize(1, 2)
|
|
20
|
+
size_2 = TwoDimSize(3, 4)
|
|
21
|
+
size_3 = size_1 + size_2
|
|
22
|
+
|
|
23
|
+
self.assertEqual(size_3.width, 4)
|
|
24
|
+
self.assertEqual(size_3.height, 6)
|
|
25
|
+
|
|
26
|
+
self.assertTrue(size_3 == TwoDimSize(4, 6))
|
|
27
|
+
|
|
28
|
+
def test_parse (self):
|
|
29
|
+
str_size = "1x2"
|
|
30
|
+
|
|
31
|
+
size = TwoDimSize.parse(str_size, 'x')
|
|
32
|
+
|
|
33
|
+
self.assertEqual(size.width, 1)
|
|
34
|
+
self.assertEqual(size.height, 2)
|
|
35
|
+
|
|
36
|
+
if __name__ == '__main__':
|
|
37
|
+
unittest.main()
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# tests/custom_types/version_info_test.py
|
|
2
|
+
|
|
3
|
+
import unittest
|
|
4
|
+
|
|
5
|
+
from anb_python_components.custom_types.version_info import VersionInfo
|
|
6
|
+
|
|
7
|
+
class VersionInfoTest(unittest.TestCase):
|
|
8
|
+
def test_init (self):
|
|
9
|
+
version_info = VersionInfo(1, 2, 3, 4, "Тестовая версия", 1)
|
|
10
|
+
version_info_str = '1.2.3.4 Тестовая версия 1'
|
|
11
|
+
|
|
12
|
+
self.assertEqual(version_info_str, str(version_info))
|
|
13
|
+
|
|
14
|
+
def test_math (self):
|
|
15
|
+
version_info_1 = VersionInfo(1, 2, 3, 4, "Тестовая версия", 1)
|
|
16
|
+
version_info_2 = VersionInfo(1, 2, 3, 4, "Тестовая версия", 1)
|
|
17
|
+
version_info_3 = VersionInfo(2, 1, 3, 10, "Тестовая версия", 2)
|
|
18
|
+
version_info_4 = VersionInfo(3, 5, 3, 12, "Тестовая версия", 3)
|
|
19
|
+
|
|
20
|
+
self.assertTrue(version_info_1 == version_info_2)
|
|
21
|
+
self.assertTrue(version_info_3 > version_info_2)
|
|
22
|
+
self.assertTrue(version_info_3 >= version_info_1)
|
|
23
|
+
self.assertTrue(version_info_1 < version_info_4)
|
|
24
|
+
self.assertTrue(version_info_3.in_range(version_info_1, version_info_4))
|
|
25
|
+
self.assertFalse(version_info_3.in_range(version_info_1, version_info_3, end_inclusive = False))
|
|
26
|
+
self.assertTrue(version_info_3.in_range(version_info_1))
|
|
27
|
+
self.assertTrue(version_info_3.in_range())
|
|
28
|
+
|
|
29
|
+
def test_parse (self):
|
|
30
|
+
str_ver_1 = '1.2.3.4 Тестовая 1'
|
|
31
|
+
version_info_1 = VersionInfo(1, 2, 3, 4, "Тестовая", 1)
|
|
32
|
+
str_ver_2 = "1.2.3.4 Тестовая"
|
|
33
|
+
version_info_2 = VersionInfo(1, 2, 3, 4, "Тестовая", 0)
|
|
34
|
+
str_ver_3 = "1.2.3.4"
|
|
35
|
+
version_info_3 = VersionInfo(1, 2, 3, 4, "", 0)
|
|
36
|
+
str_ver_4 = "1.2.3 Тестовая 1"
|
|
37
|
+
version_info_4 = VersionInfo(1, 2, 3, 0, "Тестовая", 1)
|
|
38
|
+
str_ver_5 = "1.2 Тестовая 1"
|
|
39
|
+
version_info_5 = VersionInfo(1, 2, 0, 0, "Тестовая", 1)
|
|
40
|
+
str_ver_6 = "1 Тестовая 1"
|
|
41
|
+
version_info_6 = VersionInfo(1, 0, 0, 0, "Тестовая", 1)
|
|
42
|
+
|
|
43
|
+
self.assertEqual(version_info_1, VersionInfo.parse(str_ver_1))
|
|
44
|
+
self.assertEqual(version_info_2, VersionInfo.parse(str_ver_2))
|
|
45
|
+
self.assertEqual(version_info_3, VersionInfo.parse(str_ver_3))
|
|
46
|
+
self.assertEqual(version_info_4, VersionInfo.parse(str_ver_4))
|
|
47
|
+
self.assertEqual(version_info_5, VersionInfo.parse(str_ver_5))
|
|
48
|
+
self.assertEqual(version_info_6, VersionInfo.parse(str_ver_6))
|
|
49
|
+
|
|
50
|
+
if __name__ == '__main__':
|
|
51
|
+
unittest.main()
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# tests/extensions/__init__.py
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# array_extension_test.py
|
|
2
|
+
|
|
3
|
+
import unittest
|
|
4
|
+
|
|
5
|
+
from anb_python_components.extensions.array_extension import ArrayExtension
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ArrayExtensionTest(unittest.TestCase):
|
|
9
|
+
def test_remove_empties(self):
|
|
10
|
+
array = ["Мама", "Папа", "", "", "он", "", "она", "вместе", "", "дружная", "", "семья", ""]
|
|
11
|
+
|
|
12
|
+
removed_empties = ["Мама", "Папа", "он", "она", "вместе", "дружная", "семья"]
|
|
13
|
+
|
|
14
|
+
sorted_removed_empties = ["Мама", "Папа", "вместе", "дружная", "он", "она", "семья"]
|
|
15
|
+
|
|
16
|
+
self.assertEqual(removed_empties, ArrayExtension.remove_empties(array))
|
|
17
|
+
self.assertEqual(sorted_removed_empties, ArrayExtension.remove_empties(array, True))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
if __name__ == '__main__':
|
|
21
|
+
unittest.main()
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# bool_extension_test.py
|
|
2
|
+
|
|
3
|
+
import unittest
|
|
4
|
+
|
|
5
|
+
from anb_python_components.extensions.bool_extension import *
|
|
6
|
+
|
|
7
|
+
class BoolExtensionTest(unittest.TestCase):
|
|
8
|
+
def test_to_str (self):
|
|
9
|
+
self.assertEqual(BoolExtension.to_str(True, "да", "нет"), "да")
|
|
10
|
+
self.assertEqual(BoolExtension.to_str(False, "да", "нет"), "нет")
|
|
11
|
+
|
|
12
|
+
def test_true_count (self):
|
|
13
|
+
self.assertEqual(BoolExtension.true_count([False, True, False, True, True, False, False]), 3)
|
|
14
|
+
|
|
15
|
+
def test_any_true (self):
|
|
16
|
+
self.assertTrue(BoolExtension.any_true([False, True, False, True, True, False, False]))
|
|
17
|
+
|
|
18
|
+
if __name__ == '__main__':
|
|
19
|
+
unittest.main()
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# string_extension_test.py
|
|
2
|
+
|
|
3
|
+
import unittest
|
|
4
|
+
|
|
5
|
+
from anb_python_components.extensions.string_extension import *
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class StringExtensionTest(unittest.TestCase):
|
|
9
|
+
def test_is_none_or_empty(self):
|
|
10
|
+
self.assertTrue(StringExtension.is_none_or_empty(None))
|
|
11
|
+
self.assertTrue(StringExtension.is_none_or_empty(""))
|
|
12
|
+
self.assertFalse(StringExtension.is_none_or_empty("Некий текст"))
|
|
13
|
+
self.assertFalse(StringExtension.is_none_or_empty(" "))
|
|
14
|
+
|
|
15
|
+
def test_is_none_or_whitespace(self):
|
|
16
|
+
self.assertTrue(StringExtension.is_none_or_whitespace(None))
|
|
17
|
+
self.assertTrue(StringExtension.is_none_or_whitespace(""))
|
|
18
|
+
self.assertFalse(StringExtension.is_none_or_whitespace("Некий текст"))
|
|
19
|
+
self.assertTrue(StringExtension.is_none_or_whitespace(" "))
|
|
20
|
+
|
|
21
|
+
def test_is_russian_letter(self):
|
|
22
|
+
self.assertTrue(StringExtension.is_russian_letter('п'))
|
|
23
|
+
self.assertFalse(StringExtension.is_russian_letter("p"))
|
|
24
|
+
|
|
25
|
+
def test_get_russian_letter_transliteration(self):
|
|
26
|
+
self.assertEqual(StringExtension.get_russian_letter_transliteration('Ю'), 'Yu')
|
|
27
|
+
self.assertNotEqual(StringExtension.get_russian_letter_transliteration('я'), 'Yu')
|
|
28
|
+
|
|
29
|
+
def test_convert_to_latin(self):
|
|
30
|
+
self.assertEqual(StringExtension.convert_to_latin('Россия'), 'Rossiya')
|
|
31
|
+
|
|
32
|
+
def test_compare(self):
|
|
33
|
+
self.assertEqual(StringExtension.compare('Россия', 'Россия'), 0)
|
|
34
|
+
self.assertEqual(StringExtension.compare('Россия', 'Россия', True), 0)
|
|
35
|
+
self.assertEqual(StringExtension.compare('Россия', 'россия', True), 0)
|
|
36
|
+
self.assertEqual(StringExtension.compare('Россия', 'россия'), 1)
|
|
37
|
+
self.assertEqual(StringExtension.compare('Россия - Великая держава', 'Россия'), 1)
|
|
38
|
+
self.assertEqual(StringExtension.compare('Россия', 'Россия, мы гордимся Тобою'), -1)
|
|
39
|
+
|
|
40
|
+
def test_get_short_text(self):
|
|
41
|
+
self.assertEqual(StringExtension.get_short_text('Я люблю Python', 10), 'Я люблю Py')
|
|
42
|
+
self.assertEqual(StringExtension.get_short_text('Я люблю Python', 10, '...'), 'Я люблю...')
|
|
43
|
+
|
|
44
|
+
def test_replace(self):
|
|
45
|
+
self.assertEqual(StringExtension.replace('Я люблю Python. Хотя только изучаю сам Python', 'Python', 'PHP'),
|
|
46
|
+
"Я люблю PHP. Хотя только изучаю сам PHP")
|
|
47
|
+
|
|
48
|
+
def test_replace_all(self):
|
|
49
|
+
self.assertEqual(StringExtension.replace_all({'Python': 'PHP', 'сам': 'последнюю версию'},
|
|
50
|
+
'Я люблю Python. Хотя только изучаю сам Python'),
|
|
51
|
+
"Я люблю PHP. Хотя только изучаю последнюю версию PHP")
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
if __name__ == '__main__':
|
|
55
|
+
unittest.main()
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# type_extension_test.py
|
|
2
|
+
|
|
3
|
+
import unittest
|
|
4
|
+
|
|
5
|
+
from anb_python_components.extensions.type_extension import TypeExtension
|
|
6
|
+
from anb_python_components.custom_types.guid import GUID
|
|
7
|
+
|
|
8
|
+
class DemoClass:
|
|
9
|
+
def __init__ (self, name):
|
|
10
|
+
self.name = name
|
|
11
|
+
self.age = 20
|
|
12
|
+
|
|
13
|
+
class TypeExtensionTest(unittest.TestCase):
|
|
14
|
+
|
|
15
|
+
def test_to_dict (self):
|
|
16
|
+
converted = TypeExtension.to_dict(DemoClass('Иван'))
|
|
17
|
+
self.assertEqual(converted, {'name': 'Иван', 'age': 20})
|
|
18
|
+
|
|
19
|
+
def test_from_dict (self):
|
|
20
|
+
# Представим данные в виде словаря
|
|
21
|
+
data = {'name': 'Иван', 'age': 20}
|
|
22
|
+
|
|
23
|
+
# Преобразуем данные в объект DemoClass
|
|
24
|
+
converted = TypeExtension.from_dict(data, DemoClass)
|
|
25
|
+
|
|
26
|
+
# Проверяем, что полученный объект является экземпляром DemoClass
|
|
27
|
+
self.assertIsInstance(converted, DemoClass)
|
|
28
|
+
|
|
29
|
+
# Проверяем, что объект содержит ожидаемые значения
|
|
30
|
+
self.assertEqual(converted.name, 'Иван')
|
|
31
|
+
self.assertEqual(converted.age, 20)
|
|
32
|
+
|
|
33
|
+
def test_is_immutable_type (self):
|
|
34
|
+
self.assertTrue(TypeExtension.is_immutable_type(int))
|
|
35
|
+
self.assertFalse(TypeExtension.is_immutable_type(GUID))
|
|
36
|
+
|
|
37
|
+
if __name__ == '__main__':
|
|
38
|
+
unittest.main()
|