Skip to content

Commit

Permalink
Use pretty_assertions (#1460)
Browse files Browse the repository at this point in the history
* use `pretty_assertions`

* Update bindings/core/src/method/secret_manager.rs

Co-authored-by: Thibault Martinez <[email protected]>

---------

Co-authored-by: Thibault Martinez <[email protected]>
  • Loading branch information
DaughterOfMars and thibault-martinez authored Oct 19, 2023
1 parent 6dcd242 commit 9f989b8
Show file tree
Hide file tree
Showing 106 changed files with 261 additions and 114 deletions.
24 changes: 24 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions bindings/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ thiserror = { version = "1.0.49", default-features = false }
tokio = { version = "1.33.0", default-features = false }
zeroize = { version = "1.6.0", default-features = false }

[dev-dependencies]
pretty_assertions = { version = "1.4.0", default-features = false, features = [ "alloc" ] }

[features]
events = ["iota-sdk/events"]
ledger_nano = ["iota-sdk/ledger_nano"]
Expand Down
2 changes: 2 additions & 0 deletions bindings/core/src/method/secret_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ pub enum SecretManagerMethod {

#[cfg(test)]
mod test {
use pretty_assertions::assert_eq;

#[test]
fn bip44_deserialization() {
let signature_unlock_method: super::SecretManagerMethod = serde_json::from_str(
Expand Down
1 change: 1 addition & 0 deletions bindings/core/tests/combined.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use iota_sdk::{
wallet::account::types::AccountIdentifier,
};
use iota_sdk_bindings_core::{AccountMethod, CallMethod, ClientMethod, Response, Result, WalletMethod, WalletOptions};
use pretty_assertions::assert_eq;

#[tokio::test]
async fn create_account() -> Result<()> {
Expand Down
1 change: 1 addition & 0 deletions bindings/core/tests/secrets_debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

use iota_sdk::client::secret::SecretManagerDto;
use iota_sdk_bindings_core::{ClientMethod, Response, UtilsMethod, WalletOptions};
use pretty_assertions::assert_eq;

#[test]
fn method_interface_secrets_debug() {
Expand Down
1 change: 1 addition & 0 deletions bindings/core/tests/secrets_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use std::sync::Arc;

use iota_sdk::client::{api::GetAddressesOptions, constants::ETHER_COIN_TYPE, secret::SecretManager};
use iota_sdk_bindings_core::{call_secret_manager_method, Response, Result, SecretManagerMethod};
use pretty_assertions::assert_eq;
use tokio::sync::RwLock;

#[tokio::test]
Expand Down
1 change: 1 addition & 0 deletions bindings/core/tests/serialize_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

use iota_sdk::{client::Error as ClientError, wallet::Error as WalletError};
use iota_sdk_bindings_core::Error;
use pretty_assertions::assert_eq;

#[test]
fn custom_error_serialization() {
Expand Down
1 change: 1 addition & 0 deletions bindings/core/tests/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

use iota_sdk::types::block::address::{Bech32Address, Hrp};
use iota_sdk_bindings_core::{call_utils_method, Response, Result, UtilsMethod};
use pretty_assertions::assert_eq;

#[tokio::test]
async fn utils() -> Result<()> {
Expand Down
1 change: 1 addition & 0 deletions sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ wasm-bindgen-futures = { version = "0.4.37", default-features = false, optional

[dev-dependencies]
iota-sdk = { path = ".", default-features = false, features = ["rand"] }
pretty_assertions = { version = "1.4.0", default-features = false, features = [ "alloc" ] }

dotenvy = { version = "0.15.7", default-features = false }
fern-logger = { version = "0.5.0", default-features = false }
Expand Down
2 changes: 2 additions & 0 deletions sdk/src/client/secret/ledger_nano.rs
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,8 @@ fn merge_unlocks(

#[cfg(test)]
mod tests {
use pretty_assertions::assert_eq;

use super::*;
use crate::{
client::{api::GetAddressesOptions, constants::IOTA_COIN_TYPE, secret::SecretManager},
Expand Down
2 changes: 2 additions & 0 deletions sdk/src/client/secret/mnemonic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ impl MnemonicSecretManager {

#[cfg(test)]
mod tests {
use pretty_assertions::assert_eq;

use super::*;
use crate::types::block::address::ToBech32Ext;

Expand Down
2 changes: 2 additions & 0 deletions sdk/src/client/stronghold/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,8 @@ async fn task_key_clear(
mod tests {
use std::fs;

use pretty_assertions::assert_eq;

use super::*;

#[tokio::test]
Expand Down
2 changes: 2 additions & 0 deletions sdk/src/client/stronghold/secret.rs
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,8 @@ impl StrongholdAdapter {
mod tests {
use std::path::Path;

use pretty_assertions::assert_eq;

use super::*;
use crate::{
client::constants::{ETHER_COIN_TYPE, IOTA_COIN_TYPE},
Expand Down
1 change: 1 addition & 0 deletions sdk/src/types/block/output/alias.rs
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,7 @@ pub(crate) mod dto {
#[cfg(test)]
mod tests {
use packable::PackableExt;
use pretty_assertions::assert_eq;

use super::*;
use crate::types::{
Expand Down
1 change: 1 addition & 0 deletions sdk/src/types/block/output/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ pub(crate) mod dto {
#[cfg(test)]
mod tests {
use packable::PackableExt;
use pretty_assertions::assert_eq;

use super::*;
use crate::types::{
Expand Down
2 changes: 2 additions & 0 deletions sdk/src/types/block/output/feature/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,8 @@ pub(crate) mod irc_27 {

#[cfg(test)]
mod test {
use pretty_assertions::assert_eq;

use super::*;
use crate::types::block::{address::ToBech32Ext, rand::address::rand_address};

Expand Down
2 changes: 2 additions & 0 deletions sdk/src/types/block/output/feature/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@ pub(crate) fn verify_allowed_features(features: &Features, allowed_features: Fea

#[cfg(test)]
mod test {
use pretty_assertions::assert_eq;

use super::*;

#[test]
Expand Down
1 change: 1 addition & 0 deletions sdk/src/types/block/output/foundry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,7 @@ pub(crate) mod dto {
#[cfg(test)]
mod tests {
use packable::PackableExt;
use pretty_assertions::assert_eq;

use super::*;
use crate::types::{
Expand Down
1 change: 1 addition & 0 deletions sdk/src/types/block/output/nft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,7 @@ pub(crate) mod dto {
#[cfg(test)]
mod tests {
use packable::PackableExt;
use pretty_assertions::assert_eq;

use super::*;
use crate::types::{
Expand Down
2 changes: 2 additions & 0 deletions sdk/src/types/block/output/unlock_condition/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,8 @@ pub(crate) fn verify_allowed_unlock_conditions(

#[cfg(test)]
mod test {
use pretty_assertions::assert_eq;

use super::*;

#[test]
Expand Down
Loading

0 comments on commit 9f989b8

Please sign in to comment.