Compare commits

..

No commits in common. "614ebfbc05a0d56b5dc41f319eecdc8157b45b1e" and "6a8187bc3cad6d074355f05e6741a6bf1e851ec1" have entirely different histories.

3 changed files with 19 additions and 23 deletions

View file

@ -4,7 +4,6 @@ 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"]

View file

@ -8,7 +8,6 @@ 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>,

View file

@ -10,9 +10,13 @@ pub async fn get_ckan_builder() -> CKAN {
.build() .build()
} }
#[tokio::test] #[cfg(test)]
#[ignore = "Set values for const at top of tests file locally."] mod tests {
async fn status_show() -> Result<(), Box<dyn std::error::Error>> { use super::*;
#[tokio::test]
#[ignore = "Set values for const at top of tests file locally."]
async fn status_show() -> Result<(), Box<dyn std::error::Error>> {
let ckan = get_ckan_builder().await; let ckan = get_ckan_builder().await;
let response = ckan.status_show().await?; let response = ckan.status_show().await?;
assert!(response.is_object()); assert!(response.is_object());
@ -25,11 +29,5 @@ async fn status_show() -> Result<(), Box<dyn std::error::Error>> {
.unwrap(); .unwrap();
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(())
} }