Commit 0ae82c2
committed
[tests] Fix deactivation test to exercise correct code path #1221
test_deactivation_fires_post_delete_signals was calling
device.config.templates.clear() directly without first setting the
config status to deactivating. This meant the per-instance delete
path guarded by is_deactivating_or_deactivated() in manage_vpn_clients
was never exercised, defeating the purpose of the regression test.
Replace templates.clear() with device.deactivate() which sets the
status to deactivating before clearing templates, ensuring the
post_clear handler takes the per-instance delete path. Also replace
the conditional handler.assert_called() with an unconditional
handler.assert_called_once() and add an IP release assertion.1 parent d60ec13 commit 0ae82c2
1 file changed
+5
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
919 | 919 | | |
920 | 920 | | |
921 | 921 | | |
922 | | - | |
923 | | - | |
924 | | - | |
925 | | - | |
926 | | - | |
| 922 | + | |
| 923 | + | |
927 | 924 | | |
928 | 925 | | |
929 | 926 | | |
930 | 927 | | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
931 | 931 | | |
932 | 932 | | |
933 | 933 | | |
| |||
0 commit comments