Nir Soffer has uploaded a new change for review.
Change subject: tests: Move securable tests to its own test module ......................................................................
tests: Move securable tests to its own test module
The tests were hidden in tests/main.py making it harder to find the tests.
Change-Id: I40fad51de67ad732d9a91119010a6bf889af6bc7 Signed-off-by: Nir Soffer nsoffer@redhat.com --- M tests/Makefile.am M tests/main.py 2 files changed, 1 insertion(+), 67 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/82/24482/1
diff --git a/tests/Makefile.am b/tests/Makefile.am index 44d4923..b7105ba 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -61,6 +61,7 @@ remoteFileHandlerTests.py \ resourceManagerTests.py \ schemaTests.py \ + securableTests.py \ sslTests.py \ storageMailboxTests.py \ tcTests.py \ diff --git a/tests/main.py b/tests/main.py index e2237da..1f87092 100644 --- a/tests/main.py +++ b/tests/main.py @@ -23,76 +23,9 @@
from gluster import exception as gluster_exception from storage import storage_exception -from storage.securable import secured, SecureError, unsecured from vdsm.utils import GeneralException
from testrunner import VdsmTestCase as TestCaseBase - - -class TestSecurable(TestCaseBase): - - @secured - class MySecureClass(object): - - def __init__(self): - self.secured = False - - def __is_secure__(self): - return self.secured - - def securedMethod(self): - "securedMethod docstring" - pass - - @unsecured - def unsecuredMethod(self): - "unsecuredMethod docstring" - pass - - class MyClassWithoutIsSecureMethod(object): - pass - - class MyClassIsSecureClassMethod(object): - - @classmethod - def __is_secure__(self): - pass - - def assertUnsecured(self, secureObject): - self.assertRaises(SecureError, secureObject.securedMethod) - secureObject.unsecuredMethod() - - def assertSecured(self, secureObject): - secureObject.securedMethod() - secureObject.unsecuredMethod() - - def testIsSecureMethodCheck(self): - self.assertRaises(NotImplementedError, secured, - TestSecurable.MyClassWithoutIsSecureMethod) - self.assertRaises(NotImplementedError, secured, - TestSecurable.MyClassIsSecureClassMethod) - - def testSecurable(self): - secureObject = TestSecurable.MySecureClass() - self.assertUnsecured(secureObject) - - secureObject.secured = True - self.assertSecured(secureObject) - - secureObject.secured = False - self.assertUnsecured(secureObject) - - def testSecurityOverride(self): - secureObject = TestSecurable.MySecureClass() - secureObject.securedMethod(__securityOverride=True) - - def testDocstringWrapping(self): - secureObject = TestSecurable.MySecureClass() - - self.assertEqual(secureObject.securedMethod.__doc__, - "securedMethod docstring") - self.assertEqual(secureObject.unsecuredMethod.__doc__, - "unsecuredMethod docstring")
class TestStorageExceptions(TestCaseBase):
Nir Soffer has posted comments on this change.
Change subject: tests: Move securable tests to its own test module ......................................................................
Patch Set 2: Verified+1
Now including the new test module.
oVirt Jenkins CI Server has posted comments on this change.
Change subject: tests: Move securable tests to its own test module ......................................................................
Patch Set 1: Verified-1
Build Failed
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/7245/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/6355/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/7139/ : SUCCESS
oVirt Jenkins CI Server has posted comments on this change.
Change subject: tests: Move securable tests to its own test module ......................................................................
Patch Set 2:
Build Successful
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/7246/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/6356/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/7140/ : SUCCESS
Dan Kenigsberg has posted comments on this change.
Change subject: tests: Move securable tests to its own test module ......................................................................
Patch Set 2: Code-Review+2
Dan Kenigsberg has submitted this change and it was merged.
Change subject: tests: Move securable tests to its own test module ......................................................................
tests: Move securable tests to its own test module
The tests were hidden in tests/main.py making it harder to find the tests.
Change-Id: I40fad51de67ad732d9a91119010a6bf889af6bc7 Signed-off-by: Nir Soffer nsoffer@redhat.com Reviewed-on: http://gerrit.ovirt.org/24482 Reviewed-by: Dan Kenigsberg danken@redhat.com --- M tests/Makefile.am M tests/main.py A tests/securableTests.py 3 files changed, 89 insertions(+), 67 deletions(-)
Approvals: Nir Soffer: Verified Dan Kenigsberg: Looks good to me, approved
vdsm-patches@lists.fedorahosted.org