Fixed flake violations

Change-Id: Ie643604ef84f9800f1a4fbf6c7c6f89cf96d48b1
This commit is contained in:
aviau 2014-08-16 14:28:29 -04:00 committed by Alexandre Viau
parent 5de8386101
commit fd8f858fae
5 changed files with 18 additions and 16 deletions

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from pecan import make_app
import pecan
# from pecanrest import model
@ -21,7 +21,7 @@ def setup_app(config):
# model.init_model()
app_conf = dict(config.app)
return make_app(
return pecan.make_app(
app_conf.pop('root'),
logging=getattr(config, 'logging', {}),
**app_conf

View File

@ -24,7 +24,7 @@ class HostController(rest.RestController):
@pecan.expose()
def get(self):
"""Returns a specific host """
"""Returns a specific host."""
return "Returns a specific host: " + self._id
@ -36,5 +36,5 @@ class HostsController(rest.RestController):
@pecan.expose()
def get_all(self):
""" Returns all host """
"""Returns all host."""
return "Returns all hosts"

View File

@ -17,6 +17,6 @@ from surveil.api.controllers.v1 import hosts
class V1Controller(object):
""" Version 1 API controller root."""
"""Version 1 API controller root."""
hello = hello.HelloController()
hosts = hosts.HostsController()

View File

@ -12,10 +12,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from surveil.tests.api.functionalTest import FunctionalTest
import surveil.tests.api.functionalTest
class TestRootController(FunctionalTest):
class TestRootController(surveil.tests.api.functionalTest.FunctionalTest):
def test_get(self):
response = self.app.get('/v1/hello')

View File

@ -12,21 +12,23 @@
# License for the specific language governing permissions and limitations
# under the License.
from unittest import TestCase
from pecan import set_config
from pecan.testing import load_test_app
import pecan
import pecan.testing
import unittest
__all__ = ['FunctionalTest']
class FunctionalTest(TestCase):
"""
Used for functional tests where you need to test your
literal application and its integration with the framework.
class FunctionalTest(unittest.TestCase):
"""Used for functional tests.
Used where you need to test your literal
application and its integration with the framework.
"""
def setUp(self):
self.app = load_test_app({
self.app = pecan.testing.load_test_app({
'app': {
'root': 'surveil.api.controllers.root.RootController',
'modules': ['surveil.api'],
@ -35,4 +37,4 @@ class FunctionalTest(TestCase):
})
def tearDown(self):
set_config({}, overwrite=True)
pecan.set_config({}, overwrite=True)