@@ -1516,15 +1516,16 @@ def test_image_show_human_readable(self):
15161516
15171517class TestImageUnset (TestImage ):
15181518
1519- attrs = {}
1520- attrs ['tags' ] = ['test' ]
1521- attrs ['prop' ] = 'test'
1522- attrs ['prop2' ] = 'fake'
1523- image = image_fakes .FakeImage .create_one_image (attrs )
1524-
15251519 def setUp (self ):
15261520 super (TestImageUnset , self ).setUp ()
15271521
1522+ attrs = {}
1523+ attrs ['tags' ] = ['test' ]
1524+ attrs ['hw_rng_model' ] = 'virtio'
1525+ attrs ['prop' ] = 'test'
1526+ attrs ['prop2' ] = 'fake'
1527+ self .image = image_fakes .FakeImage .create_one_image (attrs )
1528+
15281529 self .client .find_image .return_value = self .image
15291530 self .client .remove_tag .return_value = self .image
15301531 self .client .update_image .return_value = self .image
@@ -1567,46 +1568,42 @@ def test_image_unset_tag_option(self):
15671568 def test_image_unset_property_option (self ):
15681569
15691570 arglist = [
1571+ '--property' , 'hw_rng_model' ,
15701572 '--property' , 'prop' ,
15711573 self .image .id ,
15721574 ]
15731575
15741576 verifylist = [
1575- ('properties' , ['prop' ]),
1577+ ('properties' , ['hw_rng_model' , ' prop' ]),
15761578 ('image' , self .image .id )
15771579 ]
15781580 parsed_args = self .check_parser (self .cmd , arglist , verifylist )
15791581 result = self .cmd .take_action (parsed_args )
15801582
1581- kwargs = {}
15821583 self .client .update_image .assert_called_with (
1583- self .image ,
1584- properties = {'prop2' : 'fake' },
1585- ** kwargs )
1584+ self .image , properties = {'prop2' : 'fake' })
15861585
15871586 self .assertIsNone (result )
15881587
15891588 def test_image_unset_mixed_option (self ):
15901589
15911590 arglist = [
15921591 '--tag' , 'test' ,
1592+ '--property' , 'hw_rng_model' ,
15931593 '--property' , 'prop' ,
15941594 self .image .id ,
15951595 ]
15961596
15971597 verifylist = [
15981598 ('tags' , ['test' ]),
1599- ('properties' , ['prop' ]),
1599+ ('properties' , ['hw_rng_model' , ' prop' ]),
16001600 ('image' , self .image .id )
16011601 ]
16021602 parsed_args = self .check_parser (self .cmd , arglist , verifylist )
16031603 result = self .cmd .take_action (parsed_args )
16041604
1605- kwargs = {}
16061605 self .client .update_image .assert_called_with (
1607- self .image ,
1608- properties = {'prop2' : 'fake' },
1609- ** kwargs )
1606+ self .image , properties = {'prop2' : 'fake' })
16101607
16111608 self .client .remove_tag .assert_called_with (
16121609 self .image .id , 'test'
0 commit comments