mirror of
https://github.com/dathere/ckanaction.git
synced 2026-02-04 10:05:33 +00:00
Compare commits
2 commits
6a8187bc3c
...
614ebfbc05
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
614ebfbc05 | ||
|
|
baf875e177 |
3 changed files with 24 additions and 20 deletions
|
|
@ -4,6 +4,7 @@ version = "0.1.2"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
description = "Rust library crate featuring an API wrapper of the CKAN Action v3 API."
|
description = "Rust library crate featuring an API wrapper of the CKAN Action v3 API."
|
||||||
repository = "https://github.com/dathere/ckanaction"
|
repository = "https://github.com/dathere/ckanaction"
|
||||||
|
homepage = "https://ckanaction.dathere.com"
|
||||||
license = "Unlicense"
|
license = "Unlicense"
|
||||||
keywords = ["ckan"]
|
keywords = ["ckan"]
|
||||||
categories = ["api-bindings", "asynchronous"]
|
categories = ["api-bindings", "asynchronous"]
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ use bon::bon;
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
use std::{collections::HashMap, path::PathBuf};
|
use std::{collections::HashMap, path::PathBuf};
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
pub struct CKAN {
|
pub struct CKAN {
|
||||||
url: String,
|
url: String,
|
||||||
token: Option<String>,
|
token: Option<String>,
|
||||||
|
|
|
||||||
|
|
@ -10,10 +10,6 @@ pub async fn get_ckan_builder() -> CKAN {
|
||||||
.build()
|
.build()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
mod tests {
|
|
||||||
use super::*;
|
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
#[ignore = "Set values for const at top of tests file locally."]
|
#[ignore = "Set values for const at top of tests file locally."]
|
||||||
async fn status_show() -> Result<(), Box<dyn std::error::Error>> {
|
async fn status_show() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
|
|
@ -30,4 +26,10 @@ mod tests {
|
||||||
assert!(success);
|
assert!(success);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tokio::test]
|
||||||
|
async fn print_ckan_struct_with_debug() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
|
let ckan = get_ckan_builder().await;
|
||||||
|
assert_eq!(format!("{ckan:?}"), r#"CKAN { url: "", token: Some("") }"#);
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue