Fix tests

Test files from tests/var weren't included in the new repo so the
tests would fail with an exception due to missing files. To fix this
the files are copied from oslo-incubator.

Also, Python 3 requires absolute imports so this was fixed in
oslo_policy.policy.

The imports were out of order so the pep8 tests failed.

Change-Id: I1ee6c2aed9565e5472306bc715ac42b74de6c39f
This commit is contained in:
Brant Knudson 2015-01-20 11:15:13 -06:00
parent 7c9db3c70a
commit 14c680b807
10 changed files with 18 additions and 6 deletions

1
.gitignore vendored
View File

@ -11,7 +11,6 @@ build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg

View File

@ -96,14 +96,13 @@ import re
from oslo.config import cfg
from oslo.serialization import jsonutils
from oslo_policy.openstack.common import fileutils
from oslo_policy.openstack.common._i18n import _, _LE, _LI
from oslo_policy.openstack.common import log as logging
import six
import six.moves.urllib.parse as urlparse
import six.moves.urllib.request as urlrequest
from openstack.common import fileutils
from openstack.common._i18n import _, _LE, _LI
from openstack.common import log as logging
policy_opts = [
cfg.StrOpt('policy_file',

View File

@ -18,10 +18,10 @@
import os
import mock
from oslo_policy import policy
from oslo.config import cfg
from oslo.config import fixture as config
from oslo.serialization import jsonutils
from oslo_policy import policy
from oslotest import base as test_base
import six
import six.moves.urllib.parse as urlparse

View File

@ -0,0 +1,3 @@
{
"default": "role:fakeC"
}

View File

@ -0,0 +1,3 @@
{
"default": "role:fakeA"
}

View File

@ -0,0 +1,3 @@
{
"default": "role:fakeB"
}

View File

@ -0,0 +1 @@
fake

View File

@ -0,0 +1,4 @@
{
"default": "rule:admin",
"admin": "is_admin:True"
}