tests: init basic test structure

This commit is contained in:
2026-04-27 06:34:28 +09:00
parent 4aba55a1b0
commit 8ea6a671d4
3 changed files with 49 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
use kagami::sources::KagamiSource;
pub use kagami::sources::KagamiSourceGithub;
#[tokio::test]
async fn test_get_repos_by_user() -> anyhow::Result<()> {
KagamiSourceGithub::new(None)
.get_repositories_by_user("octocat", None, &Default::default())
.await
.map(|repos| {
assert!(!repos.is_empty());
for r in repos {
println!("{}: {}", r.url, r.name);
}
})?;
Ok(())
}
#[tokio::test]
async fn test_get_repos_by_organization() -> anyhow::Result<()> {
KagamiSourceGithub::new(None)
.get_repositories_by_organization("github", None, false, &Default::default())
.await
.map(|repos| {
assert!(!repos.is_empty());
for r in repos {
println!("{}: {}", r.url, r.name);
}
})?;
Ok(())
}
#[tokio::test]
async fn test_get_repos_by_stars() -> anyhow::Result<()> {
KagamiSourceGithub::new(None)
.get_repositories_by_stars("octocat", None, &Default::default())
.await
.map(|repos| {
assert!(!repos.is_empty());
for r in repos {
println!("{}: {}", r.url, r.name);
}
})?;
Ok(())
}
+1
View File
@@ -0,0 +1 @@
mod github;
+1
View File
@@ -0,0 +1 @@
mod sources;