def test_list(self): fips = {"floatingips": [{"tenant_id": "foo", "id": "foo"}]} user = mock.MagicMock() user.neutron.return_value.list_floatingips.return_value = fips self.assertEqual(fips["floatingips"], list( resources.NeutronFloatingIP(user=user, tenant_uuid="foo").list())) user.neutron.return_value.list_floatingips.assert_called_once_with( tenant_id="foo")
def test_name(self): fips = resources.NeutronFloatingIP({ "name": "foo", "description": "OoO" }) self.assertEqual(fips.name(), "OoO")