Test Values Model¶
tests.values.test_values_model
¶
test_values_model.py file for the fejao_config_parser package.
This module contains unit tests for the ValuesModel class, which is responsible for storing and managing configuration values from various sources.
¶
TestValuesModel
¶
Bases: TestCase
Test suite for the ValuesModel class.
Source code in tests/values/test_values_model.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 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 | |
Methods:¶
test_dict_with_various_types
¶
test_dict_with_various_types()
Test that dicts with various value types can be assigned.
Source code in tests/values/test_values_model.py
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | |
test_empty_dict_values
¶
test_empty_dict_values()
Test that empty dicts can be assigned to fields.
Source code in tests/values/test_values_model.py
85 86 87 88 89 90 91 92 93 94 95 96 97 | |
test_field_copy_on_initialization
¶
test_field_copy_on_initialization()
Test that ValuesModel copies input dictionaries on initialization.
Source code in tests/values/test_values_model.py
194 195 196 197 198 199 200 201 | |
test_initialization_with_all_values
¶
test_initialization_with_all_values()
Test that all fields can be set simultaneously.
Source code in tests/values/test_values_model.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | |
test_initialization_with_from_default
¶
test_initialization_with_from_default()
Test that from_default can be set and retrieved.
Source code in tests/values/test_values_model.py
26 27 28 29 30 31 32 33 34 | |
test_initialization_with_from_environment
¶
test_initialization_with_from_environment()
Test that from_environment can be set and retrieved.
Source code in tests/values/test_values_model.py
46 47 48 49 50 51 52 53 54 | |
test_initialization_with_from_file
¶
test_initialization_with_from_file()
Test that from_file can be set and retrieved.
Source code in tests/values/test_values_model.py
36 37 38 39 40 41 42 43 44 | |
test_initialization_with_from_terminal
¶
test_initialization_with_from_terminal()
Test that from_terminal can be set and retrieved.
Source code in tests/values/test_values_model.py
56 57 58 59 60 61 62 63 64 | |
test_initialization_with_no_values
¶
test_initialization_with_no_values()
Test that ValuesModel can be initialized with no values.
Source code in tests/values/test_values_model.py
17 18 19 20 21 22 23 24 | |
test_large_dict_values
¶
test_large_dict_values()
Test that large dictionaries can be assigned.
Source code in tests/values/test_values_model.py
137 138 139 140 141 142 143 144 | |
test_model_field_types
¶
test_model_field_types()
Test that fields have correct type annotations.
Source code in tests/values/test_values_model.py
146 147 148 149 150 151 152 153 | |
test_model_json_schema
¶
test_model_json_schema()
Test that model has valid JSON schema.
Source code in tests/values/test_values_model.py
172 173 174 175 176 177 178 179 180 | |
test_model_to_dict
¶
test_model_to_dict()
Test model serialization to dict.
Source code in tests/values/test_values_model.py
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | |
test_multiple_models_independence
¶
test_multiple_models_independence()
Test that multiple model instances are independent.
Source code in tests/values/test_values_model.py
211 212 213 214 215 216 217 218 | |
test_nested_dict_values
¶
test_nested_dict_values()
Test that nested dictionaries can be assigned.
Source code in tests/values/test_values_model.py
99 100 101 102 103 104 105 106 107 108 109 110 111 112 | |
test_partial_initialization
¶
test_partial_initialization()
Test initializing with only some fields.
Source code in tests/values/test_values_model.py
182 183 184 185 186 187 188 189 190 191 192 | |
test_repr_with_values
¶
test_repr_with_values()
Test string representation of model with values.
Source code in tests/values/test_values_model.py
203 204 205 206 207 208 209 | |
test_update_field_after_initialization
¶
test_update_field_after_initialization()
Test updating a field after initialization.
Source code in tests/values/test_values_model.py
220 221 222 223 224 225 226 227 228 229 | |