@@ -52,30 +52,30 @@ def test_chown(self):
5252 '1' , 2 , 3 )
5353
5454 def test_instantiate_with_default_name (self ):
55- self .client .call = Mock ()
55+ self .client .call = Mock (return_value = 4 )
5656 template = oca .VmTemplate (self .xml , self .client )
57- template .instantiate ()
57+ assert template .instantiate () == 4
5858 self .client .call .assert_called_once_with ('template.instantiate' ,
5959 '1' , '' , False , '' )
6060
6161 def test_instantiate_with_custom_name (self ):
62- self .client .call = Mock ()
62+ self .client .call = Mock (return_value = 5 )
6363 template = oca .VmTemplate (self .xml , self .client )
64- template .instantiate ('asd' )
64+ assert template .instantiate ('asd' ) == 5
6565 self .client .call .assert_called_once_with ('template.instantiate' ,
6666 '1' , 'asd' , False , '' )
6767
6868 def test_instantiate_with_default_name_and_context (self ):
69- self .client .call = Mock ()
69+ self .client .call = Mock (return_value = 6 )
7070 template = oca .VmTemplate (self .xml , self .client )
71- template .instantiate ('' , False , 'VCPU=4' )
71+ assert template .instantiate ('' , False , 'VCPU=4' ) == 6
7272 self .client .call .assert_called_once_with ('template.instantiate' ,
7373 '1' , '' , False , 'VCPU=4' )
7474
7575 def test_instantiate_with_custom_name_and_context (self ):
76- self .client .call = Mock ()
76+ self .client .call = Mock (return_value = 7 )
7777 template = oca .VmTemplate (self .xml , self .client )
78- template .instantiate ('asd' , False , 'VCPU=4' )
78+ assert template .instantiate ('asd' , False , 'VCPU=4' ) == 7
7979 self .client .call .assert_called_once_with ('template.instantiate' ,
8080 '1' , 'asd' , False , 'VCPU=4' )
8181
0 commit comments