Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feat/auto-clone-repo
Browse files Browse the repository at this point in the history
  • Loading branch information
charlykeyko committed Mar 8, 2024
2 parents 32a5baa + 3120f6c commit 24e2281
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 26 deletions.
1 change: 1 addition & 0 deletions fplus-lib/src/external_services/github.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ impl GithubWrapper {
.issues(&self.owner, &self.repo)
.get(number)
.await?;
println!("{:?}", iid);
Ok(iid)
}

Expand Down
53 changes: 27 additions & 26 deletions fplus-lib/src/parsers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,34 +341,35 @@ impl From<IssueValidData> for Datacap {
}
}

// #[cfg(test)]
// mod tests {
// use crate::external_services::github::github_async_new;
#[cfg(test)]
mod tests {
use crate::external_services::github::github_async_new;

// static OWNER: &str = "filecoin-project";
// static REPO: &str = "filplus-tooling-backend-test";
static OWNER: &str = "keyko-io";
static REPO: &str = "test-philip-second";

// #[tokio::test]
// async fn test_parser() {
// let gh = github_async_new(OWNER.to_string(), REPO.to_string()).await;
// let issue = gh.list_issue(706).await.unwrap();
// let parsed_ldn = super::ParsedIssue::from_issue_body(&issue.body.unwrap());
// dbg!(&parsed_ldn);
#[tokio::test]
async fn test_parser() {
let _ = fplus_database::setup().await;
let gh = github_async_new(OWNER.to_string(), REPO.to_string()).await;
let issue = gh.list_issue(37).await.unwrap();
let parsed_ldn = super::ParsedIssue::from_issue_body(&issue.body.unwrap());
dbg!(&parsed_ldn);

// assert_eq!(parsed_ldn.version, 1);
// assert!(!parsed_ldn.id.is_empty());
assert_eq!(parsed_ldn.version, 1);
assert!(!parsed_ldn.id.is_empty());

// assert!(!parsed_ldn.client.name.is_empty());
// assert!(!parsed_ldn.client.industry.is_empty());
// assert!(!parsed_ldn.client.region.is_empty());
// assert!(!parsed_ldn.client.website.is_empty());
// assert!(!parsed_ldn.client.social_media.is_empty());
// assert!(!parsed_ldn.client.social_media_type.is_empty());
// assert!(!parsed_ldn.client.role.is_empty());
// assert!(!parsed_ldn.project.project_id.is_empty());
// assert!(!parsed_ldn.project.history.is_empty());
// assert!(!parsed_ldn.project.associated_projects.is_empty());
assert!(!parsed_ldn.client.name.is_empty());
assert!(!parsed_ldn.client.industry.is_empty());
assert!(!parsed_ldn.client.region.is_empty());
assert!(!parsed_ldn.client.website.is_empty());
assert!(!parsed_ldn.client.social_media.is_empty());
assert!(!parsed_ldn.client.social_media_type.is_empty());
assert!(!parsed_ldn.client.role.is_empty());
assert!(!parsed_ldn.project.project_id.is_empty());
assert!(!parsed_ldn.project.history.is_empty());
assert!(!parsed_ldn.project.associated_projects.is_empty());

// assert!(!parsed_ldn.datacap.total_requested_amount.is_empty());
// }
// }
assert!(!parsed_ldn.datacap.total_requested_amount.is_empty());
}
}

0 comments on commit 24e2281

Please sign in to comment.