(self)
| 77 | assert False, msg.format(self.get.__name__) |
| 78 | |
| 79 | def test_nested_badkey(self): |
| 80 | d = {"x": 1, "y": 2, "z": (sum, ["x", "y"])} |
| 81 | |
| 82 | try: |
| 83 | result = self.get(d, [["badkey"], "y"]) |
| 84 | except KeyError: |
| 85 | pass |
| 86 | else: |
| 87 | msg = "Expected `{}` with badkey to raise KeyError.\n" |
| 88 | msg += f"Obtained '{result}' instead." |
| 89 | assert False, msg.format(self.get.__name__) |
| 90 | |
| 91 | def test_data_not_in_dict_is_ok(self): |
| 92 | d = {"x": 1, "y": (add, "x", 10)} |