From 9aece94eebaf145505287113821777d5f32cc0a6 Mon Sep 17 00:00:00 2001 From: Timur Nurlygayanov Date: Thu, 4 Apr 2013 18:36:57 +0400 Subject: [PATCH] Fixed a few small issues. --- conductor/tox.ini | 2 +- portas/portas/common/service.py | 2 +- portas/portas/tests/api/simple_test.py | 1 + portas/portas/tests/sanity_tests.py | 8 +++++--- portas/tools/test-requires | 1 + portas/tox.ini | 2 +- python-portasclient/tox.ini | 2 +- tests/selenium/tools/test_requires | 7 +++++++ 8 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 tests/selenium/tools/test_requires diff --git a/conductor/tox.ini b/conductor/tox.ini index 97f0572..9033100 100644 --- a/conductor/tox.ini +++ b/conductor/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py26,py27,pep8 +envlist = py27,pep8 [testenv] setenv = VIRTUAL_ENV={envdir} diff --git a/portas/portas/common/service.py b/portas/portas/common/service.py index 634f1ed..2c20c1f 100644 --- a/portas/portas/common/service.py +++ b/portas/portas/common/service.py @@ -55,7 +55,7 @@ class TaskResultHandlerService(service.Service): def handle_report(msg): log.debug(_('Got report message from orchestration engine:\n{0}'. - format(msg.body))) + format(msg.body))) params = anyjson.deserialize(msg.body) params['entity_id'] = params['id'] diff --git a/portas/portas/tests/api/simple_test.py b/portas/portas/tests/api/simple_test.py index 836eed3..b07f7fe 100644 --- a/portas/portas/tests/api/simple_test.py +++ b/portas/portas/tests/api/simple_test.py @@ -1,6 +1,7 @@ import unittest import portas.api.v1 as api + class Test(unittest.TestCase): def test(self): assert True diff --git a/portas/portas/tests/sanity_tests.py b/portas/portas/tests/sanity_tests.py index d6258f2..066ef66 100644 --- a/portas/portas/tests/sanity_tests.py +++ b/portas/portas/tests/sanity_tests.py @@ -3,14 +3,17 @@ from mock import MagicMock import portas.api.v1.router as router + def my_mock(link, controller, action, conditions): return [link, controller, action, conditions] + def func_mock(): return True + class SanityUnitTests(unittest2.TestCase): - + def test_api(self): router.webservers = MagicMock(create_resource=func_mock) router.sessions = MagicMock(create_resource=func_mock) @@ -19,6 +22,5 @@ class SanityUnitTests(unittest2.TestCase): mapper = MagicMock(connect=my_mock) object = router.API(mapper) - + assert object._router is not None - \ No newline at end of file diff --git a/portas/tools/test-requires b/portas/tools/test-requires index 0330b67..a7066f1 100644 --- a/portas/tools/test-requires +++ b/portas/tools/test-requires @@ -2,6 +2,7 @@ distribute>=0.6.24 # Needed for testing +unittest2 coverage fixtures>=0.3.12 mox diff --git a/portas/tox.ini b/portas/tox.ini index 646dad9..24277e9 100644 --- a/portas/tox.ini +++ b/portas/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py26,py27,pep8 +envlist = py27,pep8 [testenv] setenv = VIRTUAL_ENV={envdir} diff --git a/python-portasclient/tox.ini b/python-portasclient/tox.ini index a9eff1b..e7e306c 100644 --- a/python-portasclient/tox.ini +++ b/python-portasclient/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py26,py27,pep8 +envlist = py27,pep8 [testenv] setenv = VIRTUAL_ENV={envdir} diff --git a/tests/selenium/tools/test_requires b/tests/selenium/tools/test_requires new file mode 100644 index 0000000..fe74025 --- /dev/null +++ b/tests/selenium/tools/test_requires @@ -0,0 +1,7 @@ +xvfb +x11-xkb-utils +xfonts-100dpi +xfonts-75dpi +xfonts-scalable +xfonts-cyrillic +xserver-xorg-core \ No newline at end of file