@@ -54,6 +54,21 @@ def test_datacenter_remove_fails(self):
5454 result = self .run_command (['image' , 'datacenter' , '100' , '--remove' ])
5555 self .assertEqual (2 , result .exit_code )
5656
57+ def test_share (self ):
58+ result = self .run_command (['image' , 'share' , '123456' , '--account-id' , '654321' ])
59+ self .assert_no_fail (result )
60+ self .assertIn ("Image template 123456 was shared to account 654321." , result .output )
61+
62+ def test_share_without_id (self ):
63+ result = self .run_command (['image' , 'share' ])
64+ self .assertEqual (2 , result .exit_code )
65+ self .assertIn ("Error: Missing argument 'IDENTIFIER'." , result .output )
66+
67+ def test_share_without_id_account (self ):
68+ result = self .run_command (['image' , 'share' , "123456" ])
69+ self .assertEqual (2 , result .exit_code )
70+ self .assertIn ("Error: Missing option '--account-id'." , result .output )
71+
5772 def test_deny_share (self ):
5873 result = self .run_command (['image' , 'share-deny' , '123456' , '--account-id' , '654321' ])
5974 self .assert_no_fail (result )
0 commit comments