(a, b, status, keys, conflict_resolution)
| 133 | @example(a={'0': '0'}, b={'0': '1'}, status={'0': '0'}, keys={'0'}, |
| 134 | conflict_resolution='a wins') |
| 135 | def test_fuzzing(a, b, status, keys, conflict_resolution): |
| 136 | def _get_storage(m, instance_name): |
| 137 | s = MemoryStorage(instance_name=instance_name) |
| 138 | s.metadata = m |
| 139 | return s |
| 140 | |
| 141 | a = _get_storage(a, 'A') |
| 142 | b = _get_storage(b, 'B') |
| 143 | |
| 144 | winning_storage = (a if conflict_resolution == 'a wins' else b) |
| 145 | expected_values = {key: winning_storage.get_meta(key) |
| 146 | for key in keys |
| 147 | if key not in status} |
| 148 | |
| 149 | metasync(a, b, status, |
| 150 | keys=keys, conflict_resolution=conflict_resolution) |
| 151 | |
| 152 | for key in keys: |
| 153 | s = status.get(key, '') |
| 154 | assert a.get_meta(key) == b.get_meta(key) == s |
| 155 | if expected_values.get(key, '') and s: |
| 156 | assert s == expected_values[key] |
nothing calls this directly
no test coverage detected