def test_get_oslo_policy_enforcer_namespace(self, mock_gpe, mock_cfg): mock_gpe.return_value = mock.Mock() args = ['opg', '--namespace', 'ironic'] with mock.patch.object(sys, 'argv', args): policy.get_oslo_policy_enforcer() mock_cfg.assert_called_once_with([], project='ironic') self.assertEqual(1, mock_gpe.call_count)