| Conditions | 3 |
| Total Lines | 13 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | from sources.common.DataManipulator import DataManipulator |
||
| 9 | def test_add_value_to_dictionary(self): |
||
| 10 | fo = FileOperations() |
||
| 11 | # load testing values from JSON file |
||
| 12 | # where all cases are grouped |
||
| 13 | json_structure = fo.fn_open_file_and_get_content('dict_to_test.json') |
||
| 14 | c_dm = DataManipulator() |
||
| 15 | for add_type in json_structure: |
||
| 16 | if 'reference' not in json_structure[add_type]: |
||
| 17 | json_structure[add_type]['reference'] = None |
||
| 18 | given = c_dm.add_value_to_dictionary(json_structure[add_type]['list'], |
||
| 19 | json_structure[add_type]['add'], add_type, |
||
| 20 | json_structure[add_type]['reference']) |
||
| 21 | self.assertEqual(given, json_structure[add_type]['expected']) |
||
| 22 |