def test_get_project(self, m_cfg): project_id = mock.sentinel.project_id service = mock.sentinel.service m_cfg.neutron_defaults.project = project_id driver = default_project.DefaultServiceProjectDriver() self.assertEqual(project_id, driver.get_project(service))
def test_get_project_not_set(self): service = mock.sentinel.service driver = default_project.DefaultServiceProjectDriver() self.assertRaises(cfg.RequiredOptError, driver.get_project, service)