Esempio n. 1
0
 def test_should_create_a_routine(self):
   entry = testhelper.find_child(self._view, 'nameentry')
   entry.set_text('test')
   self._view.show_all()
   testhelper.gtk_run_dialog(self._view, gi.repository.Gtk.ResponseType.ACCEPT, testhelper.find_child(self._view, 'okedit').emit, 'clicked')
   assert(self._controller.called() == 1)
Esempio n. 2
0
def test_gtk_run_dialog():
  dialog = gi.repository.Gtk.FileChooserDialog(title = 'test_gtk_run_dialog', action = gi.repository.Gtk.FileChooserAction.OPEN, buttons = ('Cancel', gi.repository.Gtk.ResponseType.CANCEL))
  button = dialog.get_widget_for_response(gi.repository.Gtk.ResponseType.CANCEL)
  testhelper.gtk_run_dialog(dialog, gi.repository.Gtk.ResponseType.CANCEL, button.emit, 'clicked')
  dialog.close()
  testhelper.gtk_update_gui()
Esempio n. 3
0
 def test_should_delete_a_routine(self):
   self._view.show_all()
   testhelper.gtk_run_dialog(self._view, gi.repository.Gtk.ResponseType.ACCEPT, testhelper.find_child(self._view, 'okdelete').emit, 'clicked')
Esempio n. 4
0
 def test_should_run_the_dialog(self):
   testhelper.gtk_run_dialog(self._controller, gi.repository.Gtk.ResponseType.DELETE_EVENT, self._do_dialog_delete_event)
Esempio n. 5
0
 def test_should_handle_accept_response(self):
   testhelper.gtk_run_dialog(self._controller, gi.repository.Gtk.ResponseType.ACCEPT, self._do_dialog_accept)
   assert(self._plan.routines[0].intervals[0].sound == os.path.abspath(testhelper.SOUND_FILE))
Esempio n. 6
0
 def test_should_handle_accept_response(self):
   testhelper.gtk_run_dialog(self._controller, gi.repository.Gtk.ResponseType.ACCEPT, self._do_dialog_accept)
   assert(len(self._plan.routines) == 0)
Esempio n. 7
0
 def test_should_handle_accept_response(self):
   name = self._plan.routines[0].name + '2'
   testhelper.gtk_run_dialog(self._controller, gi.repository.Gtk.ResponseType.ACCEPT, self._do_dialog_accept, name)
   assert(self._plan.routines[0].name == name)
Esempio n. 8
0
 def test_should_update_an_interval_time(self):
   testhelper.gtk_run_dialog(self._controller, gi.repository.Gtk.ResponseType.ACCEPT, self._do_update_an_interval_time)
Esempio n. 9
0
 def test_should_update_a_routine_name(self):
   testhelper.gtk_run_dialog(self._controller, gi.repository.Gtk.ResponseType.ACCEPT, self._do_update_a_routine_name)
   assert(self._controller.model.routines[0].name == 'test2')
Esempio n. 10
0
 def test_should_remove_an_interval_sound(self):
   testhelper.gtk_run_dialog(self._controller, gi.repository.Gtk.ResponseType.ACCEPT, self._do_remove_an_interval_sound)
   assert(self._controller.model.routines[0].intervals[0].sound == None)
Esempio n. 11
0
 def test_should_create_a_sound_chooser_dialog(self):
   testhelper.gtk_run_dialog(self._controller, gi.repository.Gtk.ResponseType.ACCEPT, self._do_create_a_sound_chooser_dialog)
Esempio n. 12
0
 def test_should_handle_accept_response(self):
   with tempfile.TemporaryDirectory() as tmpdir:
     testhelper.gtk_run_dialog(self._controller, gi.repository.Gtk.ResponseType.ACCEPT, self._do_dialog_accept, tmpdir)
     assert(os.path.exists(self._controller.view.get_filename()) == True)