Commit c5185b8
committed
refactor: Address pre-GUI hook PR review in the Cinema 4D submitter
Mirror the review fixes applied to the Maya submitter (deadline-cloud-for-maya
PR #437):
- Extract the auto_accept confirm-callback selection into
_pre_gui_hook_confirm_callback so the branch can be unit-tested headlessly.
It returns None (run hooks without prompting) when settings.auto_accept is
enabled, otherwise qt_hook_confirmation(parent).
- Add unit tests for both paths: auto_accept enabled -> None, and
auto_accept disabled -> the confirmation dialog actually fires
(QMessageBox.question is invoked, parented to the passed-in window, and a
"Yes" reply maps to True). The disabled-path test exercises the real
qt_hook_confirmation callback rather than mocking it out.
The other Maya review items do not require changes here: the pylint
disable on the pre_gui_hooks import and the redundant pyproject version
comment were already removed, C4D's test never used pytest.importorskip,
and deadline exposes no constant for the "settings.auto_accept" config name
(core itself uses the bare string).
Signed-off-by: Leon Li <2182521+leon-li-inspire@users.noreply.github.com>1 parent cc8b9a7 commit c5185b8
2 files changed
Lines changed: 58 additions & 7 deletions
File tree
- src/deadline/cinema4d_submitter
- test/unit/deadline_submitter_for_cinema4d
Lines changed: 14 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
940 | 940 | | |
941 | 941 | | |
942 | 942 | | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
943 | 956 | | |
944 | 957 | | |
945 | 958 | | |
| |||
1033 | 1046 | | |
1034 | 1047 | | |
1035 | 1048 | | |
1036 | | - | |
1037 | | - | |
1038 | | - | |
1039 | 1049 | | |
1040 | 1050 | | |
1041 | 1051 | | |
1042 | 1052 | | |
1043 | 1053 | | |
1044 | 1054 | | |
1045 | 1055 | | |
1046 | | - | |
| 1056 | + | |
1047 | 1057 | | |
1048 | 1058 | | |
1049 | 1059 | | |
| |||
Lines changed: 44 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
11 | 17 | | |
12 | 18 | | |
13 | 19 | | |
14 | 20 | | |
| 21 | + | |
| 22 | + | |
15 | 23 | | |
16 | 24 | | |
| 25 | + | |
17 | 26 | | |
18 | 27 | | |
19 | 28 | | |
| |||
81 | 90 | | |
82 | 91 | | |
83 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
0 commit comments