MCPcopy Create free account
hub / github.com/cncf/gitvote / create_vote_error_getting_configuration_profile

Function create_vote_error_getting_configuration_profile

src/processor.rs:821–844  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

819
820 #[tokio::test]
821 async fn create_vote_error_getting_configuration_profile() {
822 let db = MockDB::new();
823 let mut gh = MockGH::new();
824 gh.expect_get_config_file()
825 .with(eq(INST_ID), eq(ORG), eq(REPO))
826 .times(1)
827 .returning(|_, _, _| Box::pin(future::ready(None)));
828 gh.expect_post_comment()
829 .withf(|inst_id, owner, repo, issue_number, body| {
830 let expected_body = tmpl::ConfigNotFound {}.render().unwrap();
831 *inst_id == INST_ID
832 && owner == ORG
833 && repo == REPO
834 && *issue_number == ISSUE_NUM
835 && body == expected_body.as_str()
836 })
837 .times(1)
838 .returning(|_, _, _, _, _| Box::pin(future::ready(Ok(COMMENT_ID))));
839
840 let (_, cmds_rx) = async_channel::unbounded();
841 let event = setup_test_issue_event();
842 let cmds_handler = CommandsHandler::new(Arc::new(db), Arc::new(gh), cmds_rx);
843 cmds_handler.create_vote(&CreateVoteInput::new(None, &Event::Issue(event))).await.unwrap();
844 }
845
846 #[tokio::test]
847 async fn create_vote_non_collaborator() {

Callers

nothing calls this directly

Calls 3

setup_test_issue_eventFunction · 0.85
IssueClass · 0.85
create_voteMethod · 0.80

Tested by

no test coverage detected