dagger-rs/crates/dagger-sdk/tests/mod.rs
kjuulh 19ed6c267f feat(sdk): re-export through lib.rs
this means that you can now use dagger_sdk::connect() instead of
dagger_sdk::client::connect();
2023-02-19 15:29:03 +01:00

22 lines
570 B
Rust

use dagger_sdk::{connect, ContainerExecOpts};
#[test]
fn test_example_container() {
let client = connect().unwrap();
let alpine = client.container(None).from("alpine:3.16.2".into());
let out = alpine
.exec(Some(ContainerExecOpts {
args: Some(vec!["cat".into(), "/etc/alpine-release".into()]),
stdin: None,
redirect_stdout: None,
redirect_stderr: None,
experimental_privileged_nesting: None,
}))
.stdout()
.unwrap();
assert_eq!(out, "3.16.2\n".to_string())
}