Commit 65162a71 authored by Sam Thursfield's avatar Sam Thursfield

functional-tests: Remove obsolete expectedFailure annotations

The custom expectedFailure annotations are now removed (the
unittest.expectedFailure class can be used if needed).

The writeback tests which were failing were actually broken due to a
typo in the testcase, not due to a bug in tracker-writeback.
parent 1ddee4b2
......@@ -28,7 +28,6 @@ from common.utils.extractor import get_tracker_extract_jsonld_output
from common.utils.helpers import log
from common.utils.writebacktest import CommonTrackerWritebackTest as CommonTrackerWritebackTest
import unittest as ut
from common.utils.expectedFailure import expectedFailureBug
REASONABLE_TIMEOUT = 5 # Seconds we wait for tracker-writeback to do the work
......@@ -139,25 +138,21 @@ class WritebackBasicDataTest (CommonTrackerWritebackTest):
# PNG tests
@expectedFailureBug ("NB#185070")
def test_021_png_title (self):
FILENAME = "test-writeback-monitored/writeback-test-4.png"
self.__writeback_test (self.get_test_filaname_png (), "image/png", "nie:title")
self.__writeback_test (self.get_test_filename_png (), "image/png", "nie:title")
@expectedFailureBug ("NB#185070")
def test_022_png_description (self):
FILENAME = "test-writeback-monitored/writeback-test-4.png"
self.__writeback_test (self.get_test_filaname_png (), "image/png", "nie:description")
#@expectedFailureBug ("NB#185070")
self.__writeback_test (self.get_test_filename_png (), "image/png", "nie:description")
#def test_023_png_keyword (self):
# FILENAME = "test-writeback-monitored/writeback-test-4.png"
# self.__writeback_test (self.get_test_filaname_png (), "image/png", "nie:keyword", "nao:hasTag:prefLabel")
# self.__writeback_test (self.get_test_filename_png (), "image/png", "nie:keyword", "nao:hasTag:prefLabel")
#@expectedFailureBug("NB#185070")
#def test_024_png_hasTag (self):
# FILENAME = "test-writeback-monitored/writeback-test-4.png"
# self.__writeback_hasTag_test (self.get_test_filaname_png (), "image/png")
# self.__writeback_hasTag_test (self.get_test_filename_png (), "image/png")
if __name__ == "__main__":
ut.main (failfast=True)
......@@ -21,7 +21,6 @@ from common.utils.writebacktest import CommonTrackerWritebackTest as CommonTrack
from common.utils.extractor import get_tracker_extract_jsonld_output
from common.utils.helpers import log
import unittest as ut
from common.utils.expectedFailure import expectedFailureBug
import os
import time
......
#!/usr/bin/python
## Code taken and modified from unittest2 framework (case.py)
## Copyright (c) 1999-2003 Steve Purcell
## Copyright (c) 2003-2010 Python Software Foundation
## Copyright (c) 2010, Nokia (ivan.frade@nokia.com)
## This module is free software, and you may redistribute it and/or modify
## it under the same terms as Python itself, so long as this copyright message
## and disclaimer are retained in their original form.
## IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
## SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
## THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
## DAMAGE.
## THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
## PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS,
## AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
## SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
"""
Write values in tracker and check the actual values are written
on the files. Note that these tests are highly platform dependant.
"""
import sys
import unittest2 as ut
from unittest2.compatibility import wraps
import configuration as cfg
def expectedFailureBug(bugnumber):
"""
Decorator to mark bugs with ExpectedFailure. In case that a expected failure PASS
it will raise an exception pointing to the Bug number.
Keep your bugs and tests in sync!
"""
def decorator (func):
@wraps(func)
def wrapper(*args, **kwargs):
try:
func(*args, **kwargs)
except Exception:
raise ut.case._ExpectedFailure(sys.exc_info())
raise Exception ("Unexpected success. This should fail because of bug " +str(bugnumber))
return wrapper
return decorator
def expectedFailureJournal():
"""
Decorator to handle tests that are expected to fail when journal is disabled.
"""
def decorator (func):
# no wrapping if journal is enabled, test is expected to pass
if not cfg.disableJournal:
return func
@wraps(func)
def wrapper(*args, **kwargs):
try:
func(*args, **kwargs)
except Exception:
raise ut.case._ExpectedFailure(sys.exc_info())
raise Exception ("Unexpected success. This should fail because journal is disabled")
return wrapper
return decorator
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment