Test Values From Type¶
tests.values.test_values_from_type
¶
test_values_from_type.py file for the fejao_config_parser package.
This module contains unit tests for the ValuesFromType class, which is responsible for converting string values to their specified types based on the configuration.
¶
TestValuesFromType
¶
Bases: TestCase
Test suite for the ValuesFromType class.
Source code in tests/values/test_values_from_type.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | |
Methods:¶
setUp
¶
setUp()
Set up a ValuesFromType instance for testing.
Source code in tests/values/test_values_from_type.py
17 18 19 | |
test_bool_false_values
¶
test_bool_false_values()
Test that various representations of false are correctly parsed as False.
Source code in tests/values/test_values_from_type.py
87 88 89 90 | |
test_bool_invalid_value_raises
¶
test_bool_invalid_value_raises()
Test that an invalid bool value raises a ValueError.
Source code in tests/values/test_values_from_type.py
153 154 155 156 157 | |
test_bool_true_values
¶
test_bool_true_values()
Test that various representations of true are correctly parsed as True.
Source code in tests/values/test_values_from_type.py
82 83 84 85 | |
test_bool_value_passed_as_bool
¶
test_bool_value_passed_as_bool()
Test that boolean values passed as bool are returned as-is.
Source code in tests/values/test_values_from_type.py
92 93 94 95 | |
test_dict_invalid_value_raises
¶
test_dict_invalid_value_raises()
Test that an invalid dict value raises a SyntaxError.
Source code in tests/values/test_values_from_type.py
183 184 185 186 187 | |
test_dict_value_parses_from_string
¶
test_dict_value_parses_from_string()
Test that dict values are correctly parsed from strings.
Source code in tests/values/test_values_from_type.py
134 135 136 137 | |
test_dict_value_returns_dict
¶
test_dict_value_returns_dict()
Test that a dict value is returned as-is.
Source code in tests/values/test_values_from_type.py
128 129 130 131 132 | |
test_float_invalid_value_raises
¶
test_float_invalid_value_raises()
Test that an invalid float value raises a ValueError.
Source code in tests/values/test_values_from_type.py
165 166 167 168 169 | |
test_float_value_parses_from_string
¶
test_float_value_parses_from_string()
Test that float values are correctly parsed from strings.
Source code in tests/values/test_values_from_type.py
102 103 104 105 | |
test_get_error_msg_is_private
¶
test_get_error_msg_is_private()
Test that __get_error_msg method is private and not directly accessible.
Source code in tests/values/test_values_from_type.py
25 26 27 28 29 30 31 | |
test_get_from_bool_is_private
¶
test_get_from_bool_is_private()
Test that __get_from_bool method is private and not directly accessible.
Source code in tests/values/test_values_from_type.py
33 34 35 36 37 38 39 | |
test_get_from_dict_is_private
¶
test_get_from_dict_is_private()
Test that __get_from_dict method is private and not directly accessible.
Source code in tests/values/test_values_from_type.py
65 66 67 68 69 70 71 | |
test_get_from_float_is_private
¶
test_get_from_float_is_private()
Test that __get_from_float method is private and not directly accessible.
Source code in tests/values/test_values_from_type.py
49 50 51 52 53 54 55 | |
test_get_from_int_is_private
¶
test_get_from_int_is_private()
Test that __get_from_int method is private and not directly accessible.
Source code in tests/values/test_values_from_type.py
41 42 43 44 45 46 47 | |
test_get_from_list_is_private
¶
test_get_from_list_is_private()
Test that __get_from_list method is private and not directly accessible.
Source code in tests/values/test_values_from_type.py
57 58 59 60 61 62 63 | |
test_int_invalid_value_raises
¶
test_int_invalid_value_raises()
Test that an invalid int value raises a ValueError.
Source code in tests/values/test_values_from_type.py
159 160 161 162 163 | |
test_int_value_parses_from_string
¶
test_int_value_parses_from_string()
Test that integer values are correctly parsed from strings.
Source code in tests/values/test_values_from_type.py
97 98 99 100 | |
test_list_invalid_value_raises
¶
test_list_invalid_value_raises()
Test that an invalid list value raises a SyntaxError.
Source code in tests/values/test_values_from_type.py
171 172 173 174 175 | |
test_list_value_parses_from_string
¶
test_list_value_parses_from_string()
Test that list values are correctly parsed from strings.
Source code in tests/values/test_values_from_type.py
112 113 114 115 116 117 118 119 120 121 | |
test_list_value_parses_from_string_empty
¶
test_list_value_parses_from_string_empty()
Test that list values are correctly parsed from string of an empty list.
Source code in tests/values/test_values_from_type.py
123 124 125 126 | |
test_list_value_returns_list
¶
test_list_value_returns_list()
Test that a list value is returned as-is.
Source code in tests/values/test_values_from_type.py
107 108 109 110 | |
test_string_returns_string
¶
test_string_returns_string()
Test that a string value is returned as-is.
Source code in tests/values/test_values_from_type.py
77 78 79 80 | |
test_unsupported_type_raises
¶
test_unsupported_type_raises()
Test that an unsupported type raises a ValueError.
Source code in tests/values/test_values_from_type.py
139 140 141 142 143 144 145 146 147 | |