142
143
pass # With no widgets, there are no widgets to fill out
149
def bind(klass, test_instance, obj, method_name):
150
original_method = getattr(obj, method_name)
151
test_instance.addCleanup(setattr, obj, method_name, original_method)
152
setattr(obj, method_name, klass())
159
def __call__(self, *args, **kwargs):
145
165
class TestCommitDialogSimple(tests.TestCaseWithTransport):
168
MockMethod.bind(self, CommitDialogNoWidgets, 'setup_params')
169
MockMethod.bind(self, CommitDialogNoWidgets, 'construct')
170
MockMethod.bind(self, CommitDialogNoWidgets, 'fill_in_data')
172
tree = self.make_branch_and_tree('tree')
173
rev_id = tree.commit('first')
174
dlg = CommitDialogNoWidgets(tree)
175
self.assertIs(tree, dlg._wt)
176
self.assertIs(None, dlg._selected)
177
self.assertTrue(dlg._enable_per_file_commits)
178
self.assertTrue(dlg._commit_all_changes)
179
self.assertIs(None, dlg.committed_revision_id)
180
self.assertIs(None, dlg._last_selected_file)
181
self.assertIsInstance(
182
dlg._saved_commit_messages_manager, SavedCommitMessagesManager)
183
self.assertTrue(CommitDialogNoWidgets.setup_params.called)
184
self.assertTrue(CommitDialogNoWidgets.construct.called)
185
self.assertTrue(CommitDialogNoWidgets.fill_in_data.called)
147
187
def test_setup_parameters_no_pending(self):
148
188
tree = self.make_branch_and_tree('tree')
149
189
rev_id = tree.commit('first')