diff --git a/test.sh b/test.sh index 18c35e3..cf87a05 100755 --- a/test.sh +++ b/test.sh @@ -1,6 +1,6 @@ #!/bin/bash -# RUST_BACKTRACE=1 cargo test --all-features -- --nocapture +RUST_BACKTRACE=1 cargo test --all-features -- --nocapture # RUST_BACKTRACE=1 cargo test --release --all-features -- --nocapture # RUST_BACKTRACE=1 cargo test --features techblox -- --nocapture -RUST_BACKTRACE=1 cargo test --features robocraft -- --nocapture +# RUST_BACKTRACE=1 cargo test --features robocraft -- --nocapture exit $? diff --git a/tests/robocraft_factory_simple.rs b/tests/robocraft_factory_simple.rs index 3b2c5db..94200b1 100644 --- a/tests/robocraft_factory_simple.rs +++ b/tests/robocraft_factory_simple.rs @@ -29,6 +29,17 @@ fn assert_factory_list(robo_info: robocraft::FactoryInfo Result<(), ()> { + let result = robocraft_simple::FactoryAPI::new().list(); + assert!(result.is_ok()); + let robo_info = result.unwrap(); + assert_factory_list(robo_info)?; + Ok(()) +} + + #[test] #[cfg(all(feature = "simple", feature = "robocraft"))] fn robocraft_factory_custom_query_simple() -> Result<(), ()> { @@ -57,8 +68,16 @@ fn robocraft_factory_custom_query_simple() -> Result<(), ()> { #[test] #[cfg(all(feature = "simple", feature = "robocraft"))] fn robocraft_factory_player_query() -> Result<(), ()> { + // hard-coding a user inevitably fails, so that's grab one from the front page + let username = robocraft_simple::FactoryAPI::new() + .list() + .unwrap() // covered by another test case + .response + .roboshop_items[0] + .added_by + .clone(); let result = builder() - .text("MilanZhi".to_string()) // there is a featured robot by this user, so this should never fail + .text(username) // there is a featured robot by this user, so this should never fail .text_search_type(robocraft::FactoryTextSearchType::Player) .items_per_page(10) .send();