tests: init basic test structure
This commit is contained in:
@@ -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("", 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(())
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
mod github;
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
mod sources;
|
||||||
Reference in New Issue
Block a user