(self)
| 62 | assert False, msg.format(self.get.__name__) |
| 63 | |
| 64 | def test_nested_badkey(self): |
| 65 | d = {"x": 1, "y": 2, "z": (sum, ["x", "y"])} |
| 66 | |
| 67 | try: |
| 68 | result = self.get(d, [["badkey"], "y"]) |
| 69 | except KeyError: |
| 70 | pass |
| 71 | else: |
| 72 | msg = "Expected `{}` with badkey to raise KeyError.\n" |
| 73 | msg += f"Obtained '{result}' instead." |
| 74 | assert False, msg.format(self.get.__name__) |
| 75 | |
| 76 | def test_data_not_in_dict_is_ok(self): |
| 77 | d = {"x": 1, "y": (add, "x", 10)} |