Skip to content

Commit 3120f6c

Browse files
authored
Merge pull request #142 from filecoin-project/feat/github-id-tests-fixes
fix: test fixes
2 parents 7c687c8 + 59870ef commit 3120f6c

File tree

2 files changed

+28
-26
lines changed

2 files changed

+28
-26
lines changed

fplus-lib/src/external_services/github.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ impl GithubWrapper {
174174
.issues(&self.owner, &self.repo)
175175
.get(number)
176176
.await?;
177+
println!("{:?}", iid);
177178
Ok(iid)
178179
}
179180

fplus-lib/src/parsers.rs

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -341,34 +341,35 @@ impl From<IssueValidData> for Datacap {
341341
}
342342
}
343343

344-
// #[cfg(test)]
345-
// mod tests {
346-
// use crate::external_services::github::github_async_new;
344+
#[cfg(test)]
345+
mod tests {
346+
use crate::external_services::github::github_async_new;
347347

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

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

358-
// assert_eq!(parsed_ldn.version, 1);
359-
// assert!(!parsed_ldn.id.is_empty());
359+
assert_eq!(parsed_ldn.version, 1);
360+
assert!(!parsed_ldn.id.is_empty());
360361

361-
// assert!(!parsed_ldn.client.name.is_empty());
362-
// assert!(!parsed_ldn.client.industry.is_empty());
363-
// assert!(!parsed_ldn.client.region.is_empty());
364-
// assert!(!parsed_ldn.client.website.is_empty());
365-
// assert!(!parsed_ldn.client.social_media.is_empty());
366-
// assert!(!parsed_ldn.client.social_media_type.is_empty());
367-
// assert!(!parsed_ldn.client.role.is_empty());
368-
// assert!(!parsed_ldn.project.project_id.is_empty());
369-
// assert!(!parsed_ldn.project.history.is_empty());
370-
// assert!(!parsed_ldn.project.associated_projects.is_empty());
362+
assert!(!parsed_ldn.client.name.is_empty());
363+
assert!(!parsed_ldn.client.industry.is_empty());
364+
assert!(!parsed_ldn.client.region.is_empty());
365+
assert!(!parsed_ldn.client.website.is_empty());
366+
assert!(!parsed_ldn.client.social_media.is_empty());
367+
assert!(!parsed_ldn.client.social_media_type.is_empty());
368+
assert!(!parsed_ldn.client.role.is_empty());
369+
assert!(!parsed_ldn.project.project_id.is_empty());
370+
assert!(!parsed_ldn.project.history.is_empty());
371+
assert!(!parsed_ldn.project.associated_projects.is_empty());
371372

372-
// assert!(!parsed_ldn.datacap.total_requested_amount.is_empty());
373-
// }
374-
// }
373+
assert!(!parsed_ldn.datacap.total_requested_amount.is_empty());
374+
}
375+
}

0 commit comments

Comments
 (0)