48 lines
1.2 KiB
Rust
48 lines
1.2 KiB
Rust
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(())
|
|
}
|