Nailgun test_update_restricted_networks fails in python2.7

Bug #1524396 reported by Bulat Gaifullin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Triaged
High
Fuel Python (Deprecated)

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:
status: New → Triaged
assignee: nobody → Fuel Python Team (fuel-python)
tags: added: area-python module-nailgun
Changed in fuel:
importance: Undecided → High
milestone: none → 8.0
Dmitry Pyzhov (dpyzhov)
tags: added: tech-debt
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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