(self)
| 10 | |
| 11 | class TestDiff(unittest.TestCase): |
| 12 | def test_simple(self): |
| 13 | self._validate_delta_only( |
| 14 | diff_delta_only(parse_one("SELECT a + b"), parse_one("SELECT a - b")), |
| 15 | [ |
| 16 | Remove(expression=parse_one("a + b")), # the Add node |
| 17 | Insert(expression=parse_one("a - b")), # the Sub node |
| 18 | Move(source=parse_one("a"), target=parse_one("a")), # the `a` Column node |
| 19 | Move(source=parse_one("b"), target=parse_one("b")), # the `b` Column node |
| 20 | ], |
| 21 | ) |
| 22 | |
| 23 | self._validate_delta_only( |
| 24 | diff_delta_only(parse_one("SELECT a, b, c"), parse_one("SELECT a, c")), |
| 25 | [ |
| 26 | Remove(expression=parse_one("b")), # the Column node |
| 27 | ], |
| 28 | ) |
| 29 | |
| 30 | self._validate_delta_only( |
| 31 | diff_delta_only(parse_one("SELECT a, b"), parse_one("SELECT a, b, c")), |
| 32 | [ |
| 33 | Insert(expression=parse_one("c")), # the Column node |
| 34 | ], |
| 35 | ) |
| 36 | |
| 37 | self._validate_delta_only( |
| 38 | diff_delta_only( |
| 39 | parse_one("SELECT a FROM table_one"), |
| 40 | parse_one("SELECT a FROM table_two"), |
| 41 | ), |
| 42 | [ |
| 43 | Update( |
| 44 | source=exp.to_table("table_one", quoted=False), |
| 45 | target=exp.to_table("table_two", quoted=False), |
| 46 | ), # the Table node |
| 47 | ], |
| 48 | ) |
| 49 | |
| 50 | def test_lambda(self): |
| 51 | self._validate_delta_only( |
nothing calls this directly
no test coverage detected