@@ -42,16 +42,12 @@ def test_rm_model(tmp_path_str):
42
42
model .save_artifact (artifact_path )
43
43
MetaHandler .write_dir (td , model .get_meta ())
44
44
45
- assert os .path .exists (
46
- os .path .join (td , "artifacts" , "artifact.txt" )
47
- )
45
+ assert os .path .exists (os .path .join (td , "artifacts" , "artifact.txt" ))
48
46
49
- result = runner .invoke (cli , args = ["artifact" , "rm" ])
47
+ result = runner .invoke (cli , args = ["artifact" , "rm" , "-y" ])
50
48
assert result .exit_code == 0
51
49
52
- assert not os .path .exists (
53
- os .path .join (td , "artifacts" , "artifact.txt" )
54
- )
50
+ assert not os .path .exists (os .path .join (td , "artifacts" , "artifact.txt" ))
55
51
56
52
57
53
def test_rm_model_error (tmp_path_str ):
@@ -63,18 +59,14 @@ def test_rm_model_error(tmp_path_str):
63
59
model .save_artifact (artifact_path )
64
60
MetaHandler .write_dir (td , model .get_meta ())
65
61
66
- assert os .path .exists (
67
- os .path .join (td , "artifacts" , "artifact.txt" )
68
- )
62
+ assert os .path .exists (os .path .join (td , "artifacts" , "artifact.txt" ))
69
63
70
- with patch (' os.remove' ) as mocked_remove :
64
+ with patch (" os.remove" ) as mocked_remove :
71
65
mocked_remove .side_effect = OSError ()
72
66
73
- result = runner .invoke (cli , args = ["artifact" , "rm" ])
67
+ result = runner .invoke (cli , args = ["artifact" , "rm" , "-y" ])
74
68
assert result .exit_code == 0
75
69
76
70
mocked_remove .assert_called_once_with (os .path .join (td , "artifacts" , "artifact.txt" ))
77
71
78
- assert os .path .exists (
79
- os .path .join (td , "artifacts" , "artifact.txt" )
80
- )
72
+ assert os .path .exists (os .path .join (td , "artifacts" , "artifact.txt" ))
0 commit comments