Nailgun test_update_restricted_networks fails in python2.7

Bug #1524397 reported by Bulat Gaifullin
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
Medium
Bulat Gaifullin

Bug Description

self = <nailgun.test.integration.test_network_manager.TestNetworkManager testMethod=test_update_restricted_networks>

    def test_update_restricted_networks(self):
        restricted_net = {
            'name': 'restricted_net',
            'restrictions': [
                'settings:additional_components.ironic.value == false'
            ]
        }
        attributes_metadata = """
                editable:
                    additional_components:
                        ironic:
                            value: %r
                            type: "checkbox"
            """
        rel = self.env.create_release()
        netw_meta = deepcopy(rel.networks_metadata)
        netw_meta['neutron']['networks'].append(restricted_net)
        rel.networks_metadata = netw_meta
        cluster = self.env.create_cluster(
            release_id=rel.id,
            api=False
        )
        self.env.create_node(cluster_id=cluster.id)
        self.assertEqual(len(filter(lambda ng: ng.name == 'restricted_net',
                                    cluster.network_groups)), 0)
        with patch.object(logger, 'warning') as mock_warn:
            objects.Cluster.patch_attributes(
                cluster, yaml.load(attributes_metadata % True))
> mock_warn.assert_called_once()

self = <MagicMock name='warning' id='4605409808'>, name = 'assert_called_once'

    def __getattr__(self, name):
        if name in ('_mock_methods', '_mock_unsafe'):
            raise AttributeError(name)
        elif self._mock_methods is not None:
            if name not in self._mock_methods or name in _all_magics:
                raise AttributeError("Mock object has no attribute %r" % name)
        elif _is_magic(name):
            raise AttributeError(name)
        if not self._mock_unsafe:
            if name.startswith(('assert', 'assret')):
> raise AttributeError(name)
E AttributeError: assert_called_once
AttributeError

Changed in fuel:
assignee: nobody → Bulat Gaifullin (bgaifullin)
milestone: none → 8.0
importance: Undecided → High
importance: High → Medium
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-web (master)

Fix proposed to branch: master
Review: https://review.openstack.org/255343

Changed in fuel:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-web (master)

Reviewed: https://review.openstack.org/255343
Committed: https://git.openstack.org/cgit/openstack/fuel-web/commit/?id=9ee8f4c1aa7c50a079250d6ab31c3c8085fc3d66
Submitter: Jenkins
Branch: master

commit 9ee8f4c1aa7c50a079250d6ab31c3c8085fc3d66
Author: Bulat Gaifullin <email address hidden>
Date: Wed Dec 9 17:37:36 2015 +0300

    Fixed test_update_restricted_networks

    Closes-Bug: #1524397
    Change-Id: Id59274d5e8982e9d09fff05f3887ff1c5521f23e

Changed in fuel:
status: In Progress → Fix Released
Dmitry Pyzhov (dpyzhov)
tags: added: area-python tech-debt
Changed in fuel:
status: Fix Released → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.