@@ -5,9 +5,13 @@ use pixi_pack::{PackOptions, PixiPackMetadata, UnpackOptions};
5
5
use rattler_conda_types:: Platform ;
6
6
use rattler_shell:: shell:: { Bash , ShellEnum } ;
7
7
use rstest:: * ;
8
- use tempfile:: tempdir;
8
+ use tempfile:: { tempdir, TempDir } ;
9
9
10
- struct Options ( PackOptions , UnpackOptions ) ;
10
+ struct Options {
11
+ pack_options : PackOptions ,
12
+ unpack_options : UnpackOptions ,
13
+ output_dir : TempDir ,
14
+ }
11
15
12
16
#[ fixture]
13
17
fn options (
@@ -21,8 +25,8 @@ fn options(
21
25
) -> Options {
22
26
let output_dir = tempdir ( ) . expect ( "Couldn't create a temp dir for tests" ) ;
23
27
let pack_file = output_dir. path ( ) . join ( "environment.tar.zstd" ) ;
24
- Options (
25
- PackOptions {
28
+ Options {
29
+ pack_options : PackOptions {
26
30
environment,
27
31
platform,
28
32
auth_file,
@@ -31,24 +35,22 @@ fn options(
31
35
metadata,
32
36
level,
33
37
} ,
34
- UnpackOptions {
38
+ unpack_options : UnpackOptions {
35
39
pack_file,
36
40
output_directory : output_dir. path ( ) . to_path_buf ( ) ,
37
41
shell,
38
42
} ,
39
- )
43
+ output_dir,
44
+ }
40
45
}
41
46
42
47
#[ rstest]
43
48
#[ tokio:: test]
44
49
async fn test_simple_python ( options : Options ) {
45
- let mut pack_options = options. 0 ;
46
- let mut unpack_options = options. 1 ;
47
- let temp_dir = tempdir ( ) . expect ( "Couldn't create a temp dir for tests" ) ;
48
- let pack_file = temp_dir. path ( ) . join ( "environment.tar.zstd" ) ;
49
- pack_options. output_file = pack_file. clone ( ) ;
50
- unpack_options. pack_file = pack_file. clone ( ) ;
51
- unpack_options. output_directory = temp_dir. path ( ) . to_path_buf ( ) ;
50
+ let pack_options = options. pack_options ;
51
+ let unpack_options = options. unpack_options ;
52
+ let _output_dir = options. output_dir ;
53
+ let pack_file = unpack_options. pack_file . clone ( ) ;
52
54
53
55
let pack_result = pixi_pack:: pack ( pack_options) . await ;
54
56
assert ! ( pack_result. is_ok( ) ) ;
0 commit comments