def test_do_validate_all_passed(self):
    profile = server.ServerProfile('t', spec)
    mock_az = self.patchobject(profile, '_validate_az')
    mock_flavor = self.patchobject(profile, '_validate_flavor')
    mock_image = self.patchobject(profile, '_validate_image')
    mock_keypair = self.patchobject(profile, '_validate_keypair')
    mock_network = self.patchobject(profile, '_validate_network')
    obj = mock.Mock()
    res = profile.do_validate(obj)
    properties = spec['properties']
    self.assertTrue(res)
    mock_az.assert_called_once_with(obj, properties['availability_zone'])
    mock_flavor.assert_called_once_with(obj, properties['flavor'])
    mock_image.assert_called_once_with(obj, properties['image'])
    mock_keypair.assert_called_once_with(obj, properties['key_name'])
    mock_network.assert_called_once_with(obj, properties['networks'][0])
def test_do_validate_all_passed(self):
    profile = server.ServerProfile('t', spec)
    mock_az = self.patchobject(profile, '_validate_az')
    mock_flavor = self.patchobject(profile, '_validate_flavor')
    mock_image = self.patchobject(profile, '_validate_image')
    mock_keypair = self.patchobject(profile, '_validate_keypair')
    mock_network = self.patchobject(profile, '_validate_network')
    obj = mock.Mock()
    res = profile.do_validate(obj)
    properties = spec['properties']
    self.assertTrue(res)
    mock_az.assert_called_once_with(obj, properties['availability_zone'])
    mock_flavor.assert_called_once_with(obj, properties['flavor'])
    mock_image.assert_called_once_with(obj, properties['image'])
    mock_keypair.assert_called_once_with(obj, properties['key_name'])
    mock_network.assert_called_once_with(obj, properties['networks'][0])