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