• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python signals.emit函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中taiga_ncurses.ui.signals.emit函数的典型用法代码示例。如果您正苦于以下问题:Python emit函数的具体用法?Python emit怎么用?Python emit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了emit函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_sprint_controller_submit_edit_task_form_successfully

def test_sprint_controller_submit_edit_task_form_successfully():
    task_subject = "Update a task"
    task_user_story = 12
    project = factories.project()
    project_view = views.projects.ProjectDetailView(project)
    project_view.sprint.notifier = mock.Mock()
    executor = factories.patched_executor(update_task_response=factories.future(
                           factories.successful_update_task_response(task_subject, task_user_story)))
    _ = mock.Mock()
    project_detail_controller = controllers.projects.ProjectDetailController(project_view, executor, _)
    project_detail_controller.handle(settings.data.main.keys.milestone)
    project_detail_controller.sprint.view.taskboard.widget.set_focus(1)
    project_detail_controller.handle(settings.data.milestone.keys.edit)
    form = project_detail_controller.sprint.view.task_form
    project_view.sprint.notifier.reset_mock()

    form._subject_edit.set_edit_text(task_subject)
    form._user_story_combo.get_selected().value = task_user_story

    signals.emit(form.save_button, "click")
    assert project_view.sprint.notifier.info_msg.call_count == 1
    assert (executor.update_task.call_args.call_list()[0][0][0]["id"] == form.task["id"])
    assert executor.update_task.call_args.call_list()[0][0][1]["subject"] == task_subject
    assert (executor.update_task.call_args.call_list()[0][0][1]["milestone"] ==
            project_detail_controller.sprint.view._milestone["id"])
    assert executor.update_task.call_args.call_list()[0][0][1]["user_story"] == task_user_story
    assert executor.update_task.call_count == 1
    assert executor.update_task.return_value.result()["subject"] == task_subject
    assert (executor.update_task.return_value.result()["milestone"] ==
            project_detail_controller.sprint.view._milestone["id"])
    assert executor.update_task.return_value.result()["user_story"] == task_user_story
开发者ID:AVert,项目名称:taiga-ncurses,代码行数:31,代码来源:test_milestones_controller.py


示例2: test_issues_controller_submit_the_filters_popup

def test_issues_controller_submit_the_filters_popup():
    project = factories.project()
    project_view = views.projects.ProjectDetailView(project)
    project_view.issues.notifier = mock.Mock()
    executor = factories.patched_executor()
    _ = mock.Mock()
    project_detail_controller = controllers.projects.ProjectDetailController(project_view, executor, _)
    project_detail_controller.handle(config.ProjectKeys.ISSUES)
    project_detail_controller.handle(config.ProjectIssuesKeys.FILTERS)
    filters_popup = project_detail_controller.view.issues.filters_popup
    project_view.issues.notifier.reset_mock()
    executor.issues.reset_mock()

    assert project_view.issues.notifier.info_msg.call_count == 0
    assert executor.issues.call_count == 0
    filters_popup._issue_types_group[0].set_state(True)
    filters_popup._issue_statuses_group[0].set_state(True)
    filters_popup._priorities_group[0].set_state(True)
    filters_popup._severities_group[0].set_state(True)
    filters_popup._assigned_to_group[0].set_state(True)
    filters_popup._created_by_group[0].set_state(True)
    #filters_popup._tags_group[0].set_state(True)
    signals.emit(filters_popup.filter_button, "click")
    assert project_view.issues.notifier.info_msg.call_count == 1
    assert executor.issues.call_count == 1
    assert len(filters_popup._filters) == 7
    assert len(executor.issues.call_args.call_list()[0][1]["filters"]["type"]) == 1
    assert len(executor.issues.call_args.call_list()[0][1]["filters"]["status"]) == 1
    assert len(executor.issues.call_args.call_list()[0][1]["filters"]["severity"]) == 1
    assert len(executor.issues.call_args.call_list()[0][1]["filters"]["priority"]) == 1
    assert len(executor.issues.call_args.call_list()[0][1]["filters"]["assigned_to"]) == 1
    assert len(executor.issues.call_args.call_list()[0][1]["filters"]["owner"]) == 1
开发者ID:joseph-hurtado,项目名称:taiga-ncurses,代码行数:32,代码来源:test_issues_controller.py


示例3: test_sprint_controller_change_to_another_milestone

def test_sprint_controller_change_to_another_milestone():
    project = factories.project()
    project_view = views.projects.ProjectDetailView(project)
    project_view.sprint.notifier = mock.Mock()
    executor = factories.patched_executor()
    _ = mock.Mock()
    project_detail_controller = controllers.projects.ProjectDetailController(project_view, executor, _)
    project_detail_controller.handle(settings.data.main.keys.milestone)
    project_detail_controller.handle(settings.data.milestone.keys.change_to_milestone)
    milestone_selector_popup = project_detail_controller.view.sprint.milestone_selector_popup
    project_view.sprint.notifier.reset_mock()
    executor.milestone.reset_mock()
    executor.milestone_stats.reset_mock()
    executor.user_stories.reset_mock()
    executor.tasks.reset_mock()

    assert project_view.sprint.notifier.info_msg.call_count == 0
    assert executor.milestone.call_count == 0
    assert executor.milestone_stats.call_count == 0
    assert executor.user_stories.call_count == 0
    assert executor.tasks.call_count == 0
    signals.emit(milestone_selector_popup.options[2], "click")
    assert project_view.sprint.notifier.info_msg.call_count == 1
    assert executor.milestone.call_count == 1
    assert executor.milestone_stats.call_count == 1
    assert executor.user_stories.call_count == 1
    assert executor.tasks.call_count == 1
    assert (project_detail_controller.sprint.view._milestone["id"] ==
            milestone_selector_popup.project["list_of_milestones"][-1]["id"])
开发者ID:AVert,项目名称:taiga-ncurses,代码行数:29,代码来源:test_milestones_controller.py


示例4: test_when_clicking_login_button_controllers_handle_login_method_is_called

def test_when_clicking_login_button_controllers_handle_login_method_is_called():
    login_view = factories.login_view("", "")
    _ = mock.Mock()
    login_controller = controllers.auth.LoginController(login_view, _, _)
    login_controller.handle_login_request = mock.Mock()
    signals.emit(login_view.login_button, "click")
    assert login_controller.handle_login_request.call_count == 1
开发者ID:AVert,项目名称:taiga-ncurses,代码行数:7,代码来源:test_project_controller.py


示例5: test_projects_controller_click_on_project_requests_the_project_detail

def test_projects_controller_click_on_project_requests_the_project_detail():
    projects = factories.projects()
    projects_view = views.projects.ProjectsView()
    executor = factories.patched_executor()
    _ = mock.Mock()
    projects_controller = controllers.projects.ProjectsController(projects_view, executor, _)

    signals.emit(projects_view.project_buttons[0], "click")

    executor.project_detail.assert_called_with(projects[0])
开发者ID:AVert,项目名称:taiga-ncurses,代码行数:10,代码来源:test_project_controller.py


示例6: test_login_controller_prints_an_error_message_on_unsuccessful_login

def test_login_controller_prints_an_error_message_on_unsuccessful_login():
    login_view = factories.login_view("admin", "123123")
    login_view.notifier = mock.Mock()
    executor = factories.patched_executor(login_response=factories.future(None))
    _ = mock.Mock()
    login_controller = controllers.auth.LoginController(login_view, executor, _)

    signals.emit(login_view.login_button, "click")

    assert login_view.notifier.error_msg.call_count == 1
开发者ID:AVert,项目名称:taiga-ncurses,代码行数:10,代码来源:test_project_controller.py


示例7: test_projects_controller_when_requesting_a_project_info_message_is_shown

def test_projects_controller_when_requesting_a_project_info_message_is_shown():
    projects = factories.projects()
    projects_view = views.projects.ProjectsView()
    projects_view.notifier = mock.Mock()
    executor = factories.patched_executor()
    _ = mock.Mock()
    projects_controller = controllers.projects.ProjectsController(projects_view, executor, _)

    signals.emit(projects_view.project_buttons[0], "click")

    assert projects_view.notifier.info_msg.call_count == 1
开发者ID:AVert,项目名称:taiga-ncurses,代码行数:11,代码来源:test_project_controller.py


示例8: test_projects_controller_click_on_project_when_project_is_fetched_transitions_to_project_detail

def test_projects_controller_click_on_project_when_project_is_fetched_transitions_to_project_detail():
    projects = factories.projects()
    fetched_project = projects[0]
    projects_view = views.projects.ProjectsView()
    executor = factories.patched_executor(project_detail=factories.future(fetched_project))
    state_machine = mock.Mock()
    projects_controller = controllers.projects.ProjectsController(projects_view, executor, state_machine)

    signals.emit(projects_view.project_buttons[0], "click")

    state_machine.project_detail.assert_called_with(fetched_project)
开发者ID:AVert,项目名称:taiga-ncurses,代码行数:11,代码来源:test_project_controller.py


示例9: test_backlog_controller_cancel_the_new_user_story_form

def test_backlog_controller_cancel_the_new_user_story_form():
    project = factories.project()
    project_view = views.projects.ProjectDetailView(project)
    executor = factories.patched_executor()
    _ = mock.Mock()
    project_detail_controller = controllers.projects.ProjectDetailController(project_view, executor, _)
    project_detail_controller.handle(settings.data.backlog.keys.create)

    assert hasattr(project_detail_controller.view.backlog, "user_story_form")
    form = project_detail_controller.view.backlog.user_story_form
    signals.emit(form.cancel_button, "click")
    assert not hasattr(project_detail_controller.view.backlog, "user_story_form")
开发者ID:AVert,项目名称:taiga-ncurses,代码行数:12,代码来源:test_backlog_controller.py


示例10: test_backlog_controller_close_the_milestone_selector_popup

def test_backlog_controller_close_the_milestone_selector_popup():
    project = factories.project()
    project_view = views.projects.ProjectDetailView(project)
    executor = factories.patched_executor()
    _ = mock.Mock()
    project_detail_controller = controllers.projects.ProjectDetailController(project_view, executor, _)
    project_detail_controller.handle(settings.data.backlog.keys.move_to_milestone)

    assert hasattr(project_detail_controller.view.backlog, "milestone_selector_popup")
    milestone_selector_popup = project_detail_controller.view.backlog.milestone_selector_popup
    signals.emit(milestone_selector_popup.cancel_button, "click")
    assert not hasattr(project_detail_controller.view.backlog, "milestone_selector_popup")
开发者ID:AVert,项目名称:taiga-ncurses,代码行数:12,代码来源:test_backlog_controller.py


示例11: test_backlog_controller_submit_new_user_stories_in_bulk_form_with_errors

def test_backlog_controller_submit_new_user_stories_in_bulk_form_with_errors():
    project = factories.project()
    project_view = views.projects.ProjectDetailView(project)
    project_view.backlog.notifier = mock.Mock()
    executor = factories.patched_executor()
    _ = mock.Mock()
    project_detail_controller = controllers.projects.ProjectDetailController(project_view, executor, _)
    project_detail_controller.handle(config.ProjectBacklogKeys.CREATE_USER_STORIES_IN_BULK)
    form = project_detail_controller.view.backlog.user_stories_in_bulk_form

    signals.emit(form.save_button, "click")
    assert project_view.backlog.notifier.error_msg.call_count == 1
开发者ID:joseph-hurtado,项目名称:taiga-ncurses,代码行数:12,代码来源:test_backlog_controller.py


示例12: test_backlog_controller_cancel_the_new_user_stories_in_bulk_form

def test_backlog_controller_cancel_the_new_user_stories_in_bulk_form():
    project = factories.project()
    project_view = views.projects.ProjectDetailView(project)
    executor = factories.patched_executor()
    _ = mock.Mock()
    project_detail_controller = controllers.projects.ProjectDetailController(project_view, executor, _)
    project_detail_controller.handle(config.ProjectBacklogKeys.CREATE_USER_STORIES_IN_BULK)

    assert hasattr(project_detail_controller.view.backlog, "user_stories_in_bulk_form")
    form = project_detail_controller.view.backlog.user_stories_in_bulk_form
    signals.emit(form.cancel_button, "click")
    assert not hasattr(project_detail_controller.view.backlog, "user_stories_in_bulk_form")
开发者ID:joseph-hurtado,项目名称:taiga-ncurses,代码行数:12,代码来源:test_backlog_controller.py


示例13: test_backlog_controller_close_the_milestone_selector_popup

def test_backlog_controller_close_the_milestone_selector_popup():
    project = factories.project()
    project_view = views.projects.ProjectDetailView(project)
    executor = factories.patched_executor()
    _ = mock.Mock()
    project_detail_controller = controllers.projects.ProjectDetailController(project_view, executor, _)
    project_detail_controller.handle(config.ProjectBacklogKeys.MOVE_US_TO_MILESTONE)

    assert hasattr(project_detail_controller.view.backlog, "milestone_selector_popup")
    milestone_selector_popup = project_detail_controller.view.backlog.milestone_selector_popup
    signals.emit(milestone_selector_popup.cancel_button, "click")
    assert not hasattr(project_detail_controller.view.backlog, "milestone_selector_popup")
开发者ID:joseph-hurtado,项目名称:taiga-ncurses,代码行数:12,代码来源:test_backlog_controller.py


示例14: test_backlog_controller_close_the_help_popup

def test_backlog_controller_close_the_help_popup():
    project = factories.project()
    project_view = views.projects.ProjectDetailView(project)
    executor = factories.patched_executor()
    _ = mock.Mock()
    project_detail_controller = controllers.projects.ProjectDetailController(project_view, executor, _)
    project_detail_controller.handle(config.ProjectBacklogKeys.HELP)

    assert hasattr(project_detail_controller.view.backlog, "help_popup")
    help_popup = project_detail_controller.view.backlog.help_popup
    signals.emit(help_popup.close_button, "click")
    assert not hasattr(project_detail_controller.view.backlog, "help_popup")
开发者ID:joseph-hurtado,项目名称:taiga-ncurses,代码行数:12,代码来源:test_backlog_controller.py


示例15: test_backlog_controller_submit_new_user_story_form_with_errors

def test_backlog_controller_submit_new_user_story_form_with_errors():
    project = factories.project()
    project_view = views.projects.ProjectDetailView(project)
    project_view.backlog.notifier = mock.Mock()
    executor = factories.patched_executor()
    _ = mock.Mock()
    project_detail_controller = controllers.projects.ProjectDetailController(project_view, executor, _)
    project_detail_controller.handle(settings.data.backlog.keys.create)
    form = project_detail_controller.view.backlog.user_story_form

    signals.emit(form.save_button, "click")
    assert project_view.backlog.notifier.error_msg.call_count == 1
开发者ID:AVert,项目名称:taiga-ncurses,代码行数:12,代码来源:test_backlog_controller.py


示例16: test_projects_controller_when_project_fetching_fails_a_error_message_is_shown

def test_projects_controller_when_project_fetching_fails_a_error_message_is_shown():
    projects = factories.projects()
    fetched_project = projects[0]
    projects_view = views.projects.ProjectsView()
    projects_view.notifier = mock.Mock()
    executor = factories.patched_executor(project_detail=factories.future(None))
    _ = mock.Mock()
    projects_controller = controllers.projects.ProjectsController(projects_view, executor, _)

    signals.emit(projects_view.project_buttons[0], "click")

    assert projects_view.notifier.error_msg.call_count == 1
开发者ID:AVert,项目名称:taiga-ncurses,代码行数:12,代码来源:test_project_controller.py


示例17: test_sprints_controller_close_the_help_popup

def test_sprints_controller_close_the_help_popup():
    project = factories.project()
    project_view = views.projects.ProjectDetailView(project)
    executor = factories.patched_executor()
    _ = mock.Mock()
    project_detail_controller = controllers.projects.ProjectDetailController(project_view, executor, _)
    project_detail_controller.handle(settings.data.main.keys.milestone)
    project_detail_controller.handle(settings.data.milestone.keys.help)

    assert hasattr(project_detail_controller.view.sprint, "help_popup")
    help_popup = project_detail_controller.view.sprint.help_popup
    signals.emit(help_popup.close_button, "click")
    assert not hasattr(project_detail_controller.view.sprint, "help_popup")
开发者ID:AVert,项目名称:taiga-ncurses,代码行数:13,代码来源:test_milestones_controller.py


示例18: test_sprint_controller_cancel_the_edit_user_story_form

def test_sprint_controller_cancel_the_edit_user_story_form():
    project = factories.project()
    project_view = views.projects.ProjectDetailView(project)
    executor = factories.patched_executor()
    _ = mock.Mock()
    project_detail_controller = controllers.projects.ProjectDetailController(project_view, executor, _)
    project_detail_controller.handle(settings.data.main.keys.milestone)
    project_detail_controller.handle(settings.data.milestone.keys.edit)

    assert hasattr(project_detail_controller.sprint.view, "user_story_form")
    form = project_detail_controller.sprint.view.user_story_form
    signals.emit(form.cancel_button, "click")
    assert not hasattr(project_detail_controller.sprint.view, "user_story_form")
开发者ID:AVert,项目名称:taiga-ncurses,代码行数:13,代码来源:test_milestones_controller.py


示例19: test_sprint_controller_cancel_the_new_user_story_form

def test_sprint_controller_cancel_the_new_user_story_form():
    project = factories.project()
    project_view = views.projects.ProjectDetailView(project)
    executor = factories.patched_executor()
    _ = mock.Mock()
    project_detail_controller = controllers.projects.ProjectDetailController(project_view, executor, _)
    project_detail_controller.handle(config.ProjectKeys.MILESTONES)
    project_detail_controller.handle(config.ProjectMilestoneKeys.CREATE_USER_STORY)

    assert hasattr(project_detail_controller.sprint.view, "user_story_form")
    form = project_detail_controller.sprint.view.user_story_form
    signals.emit(form.cancel_button, "click")
    assert not hasattr(project_detail_controller.sprint.view, "user_story_form")
开发者ID:joseph-hurtado,项目名称:taiga-ncurses,代码行数:13,代码来源:test_milestones_controller.py


示例20: test_backlog_controller_submit_the_edit_user_story_form_with_errors

def test_backlog_controller_submit_the_edit_user_story_form_with_errors():
    project = factories.project()
    project_view = views.projects.ProjectDetailView(project)
    project_view.backlog.notifier = mock.Mock()
    executor = factories.patched_executor()
    _ = mock.Mock()
    project_detail_controller = controllers.projects.ProjectDetailController(project_view, executor, _)
    project_detail_controller.handle(config.ProjectBacklogKeys.EDIT_USER_STORY)
    form = project_detail_controller.view.backlog.user_story_form

    form._subject_edit.set_edit_text("")
    signals.emit(form.save_button, "click")
    assert project_view.backlog.notifier.error_msg.call_count == 1
开发者ID:joseph-hurtado,项目名称:taiga-ncurses,代码行数:13,代码来源:test_backlog_controller.py



注:本文中的taiga_ncurses.ui.signals.emit函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python base.Location类代码示例发布时间:2022-05-27
下一篇:
Python services.get_watched_list函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap