diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-02-04 08:08:27 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-02-07 20:37:05 +0100 |
| commit | 7119f40c9881666b6f9b5cf7df09ee1d21cc8344 (patch) | |
| tree | fa50869f5614295f462d9bf77fec59365c621609 /tests/migrations/test_graph.py | |
| parent | 9c19aff7c7561e3a82978a272ecdaad40dda5c00 (diff) | |
Refs #33476 -- Refactored code to strictly match 88 characters line length.
Diffstat (limited to 'tests/migrations/test_graph.py')
| -rw-r--r-- | tests/migrations/test_graph.py | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/tests/migrations/test_graph.py b/tests/migrations/test_graph.py index f62b44180a..a9efb172d9 100644 --- a/tests/migrations/test_graph.py +++ b/tests/migrations/test_graph.py @@ -240,7 +240,10 @@ class GraphTests(SimpleTestCase): graph.add_node(("app_b", "0001"), None) graph.add_dependency("app_a.0003", ("app_a", "0003"), ("app_a", "0002")) graph.add_dependency("app_a.0002", ("app_a", "0002"), ("app_a", "0001")) - msg = "Migration app_a.0001 dependencies reference nonexistent parent node ('app_b', '0002')" + msg = ( + "Migration app_a.0001 dependencies reference nonexistent parent node " + "('app_b', '0002')" + ) with self.assertRaisesMessage(NodeNotFoundError, msg): graph.add_dependency("app_a.0001", ("app_a", "0001"), ("app_b", "0002")) @@ -251,7 +254,10 @@ class GraphTests(SimpleTestCase): # Build graph graph = MigrationGraph() graph.add_node(("app_a", "0001"), None) - msg = "Migration app_a.0002 dependencies reference nonexistent child node ('app_a', '0002')" + msg = ( + "Migration app_a.0002 dependencies reference nonexistent child node " + "('app_a', '0002')" + ) with self.assertRaisesMessage(NodeNotFoundError, msg): graph.add_dependency("app_a.0002", ("app_a", "0002"), ("app_a", "0001")) @@ -261,7 +267,10 @@ class GraphTests(SimpleTestCase): graph.add_dependency( "app_a.0001", ("app_a", "0001"), ("app_b", "0002"), skip_validation=True ) - msg = "Migration app_a.0001 dependencies reference nonexistent parent node ('app_b', '0002')" + msg = ( + "Migration app_a.0001 dependencies reference nonexistent parent node " + "('app_b', '0002')" + ) with self.assertRaisesMessage(NodeNotFoundError, msg): graph.validate_consistency() @@ -271,7 +280,10 @@ class GraphTests(SimpleTestCase): graph.add_dependency( "app_b.0002", ("app_a", "0001"), ("app_b", "0002"), skip_validation=True ) - msg = "Migration app_b.0002 dependencies reference nonexistent child node ('app_a', '0001')" + msg = ( + "Migration app_b.0002 dependencies reference nonexistent child node " + "('app_a', '0001')" + ) with self.assertRaisesMessage(NodeNotFoundError, msg): graph.validate_consistency() @@ -323,8 +335,8 @@ class GraphTests(SimpleTestCase): ) # Try replacing before replacement node exists. msg = ( - "Unable to find replacement node ('app_a', '0001_squashed_0002'). It was either" - " never added to the migration graph, or has been removed." + "Unable to find replacement node ('app_a', '0001_squashed_0002'). It was " + "either never added to the migration graph, or has been removed." ) with self.assertRaisesMessage(NodeNotFoundError, msg): graph.remove_replaced_nodes( @@ -387,7 +399,8 @@ class GraphTests(SimpleTestCase): child_node = graph.node_map[("app_b", "0001")] self.assertIn(child_node, replaced_node.children) self.assertIn(replaced_node, child_node.parents) - # Ensure child dependency hasn't also gotten remapped to the other replaced node. + # Child dependency hasn't also gotten remapped to the other replaced + # node. other_replaced_node = graph.node_map[("app_a", "0001")] self.assertNotIn(child_node, other_replaced_node.children) self.assertNotIn(other_replaced_node, child_node.parents) |
