You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bloodhound.apache.org by rj...@apache.org on 2014/02/11 02:52:32 UTC
svn commit: r1566948 [2/4] - in /bloodhound/trunk: bloodhound_dashboard/
bloodhound_dashboard/bhdashboard/ bloodhound_dashboard/bhdashboard/layouts/
bloodhound_dashboard/bhdashboard/tests/
bloodhound_dashboard/bhdashboard/widgets/ bloodhound_dashboard/...
Modified: bloodhound/trunk/bloodhound_multiproduct/multiproduct/ticket/query.py
URL: http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/multiproduct/ticket/query.py?rev=1566948&r1=1566947&r2=1566948&view=diff
==============================================================================
--- bloodhound/trunk/bloodhound_multiproduct/multiproduct/ticket/query.py (original)
+++ bloodhound/trunk/bloodhound_multiproduct/multiproduct/ticket/query.py Tue Feb 11 01:52:30 2014
@@ -48,11 +48,11 @@ from multiproduct.env import lookup_prod
class ProductQuery(Query):
"""Product Overrides for TracQuery.
-
+
This class allows for writing TracQuery expressions matching resources
beyond product boundaries.
"""
-
+
def _count(self, sql, args):
if isinstance(self.env, ProductEnvironment):
return super(ProductQuery, self)._count(sql, args)
@@ -66,7 +66,7 @@ class ProductQuery(Query):
def get_columns(self):
super(ProductQuery, self).get_columns()
if not 'product' in self.cols and self.group != 'product':
- # make sure 'product' is always present
+ # make sure 'product' is always present
# (needed for product context, href, permission checks ...)
# but don't implicitly include it if items are grouped by product
self.cols.insert(0, 'product')
@@ -169,7 +169,7 @@ trac.ticket.QueryModule = ProductQueryMo
class ProductTicketQueryMacro(TicketQueryMacro):
- """TracQuery macro retrieving results across product boundaries.
+ """TracQuery macro retrieving results across product boundaries.
"""
@staticmethod
def parse_args(content):
@@ -320,7 +320,7 @@ class ProductTicketQueryMacro(TicketQuer
env = lookup_product_env(self.env, prefix=pvalue,
name=pvalue)
except LookupError:
- return tag.a('#%s' % ticket['id'],
+ return tag.a('#%s' % ticket['id'],
class_='missing product')
hrefcache[pvalue] = envhref = \
resolve_product_href(to_env=env, at_env=self.env)
Modified: bloodhound/trunk/bloodhound_multiproduct/multiproduct/ticket/web_ui.py
URL: http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/multiproduct/ticket/web_ui.py?rev=1566948&r1=1566947&r2=1566948&view=diff
==============================================================================
--- bloodhound/trunk/bloodhound_multiproduct/multiproduct/ticket/web_ui.py (original)
+++ bloodhound/trunk/bloodhound_multiproduct/multiproduct/ticket/web_ui.py Tue Feb 11 01:52:30 2014
@@ -42,7 +42,7 @@ from multiproduct.web_ui import ProductM
class ProductTicketModule(TicketModule):
"""Product Overrides for the TicketModule"""
-
+
# IRequestHandler methods
#def match_request(self, req):
# override not yet required
@@ -103,18 +103,18 @@ class ProductTicketModule(TicketModule):
req.redirect(req.href.products(prefix, 'ticket', tid))
# INavigationContributor methods
-
+
#def get_active_navigation_item(self, req):
# override not yet required
def get_navigation_items(self, req):
"""Overriding TicketModules New Ticket nav item"""
return
-
+
# ISearchSource methods
#def get_search_filters(self, req):
# override not yet required
-
+
def get_search_results(self, req, terms, filters):
"""Overriding search results for Tickets"""
if not 'ticket' in filters:
@@ -122,7 +122,7 @@ class ProductTicketModule(TicketModule):
ticket_realm = Resource('ticket')
with self.env.db_query as db:
sql, args = search_to_sql(db, ['summary', 'keywords',
- 'description', 'reporter', 'cc',
+ 'description', 'reporter', 'cc',
db.cast('id', 'text')], terms)
sql2, args2 = search_to_sql(db, ['newvalue'], terms)
sql3, args3 = search_to_sql(db, ['value'], terms)
@@ -131,10 +131,10 @@ class ProductTicketModule(TicketModule):
productsql = "product='%s' AND" % req.args.get('product')
else:
productsql = ""
-
+
for summary, desc, author, type, tid, ts, status, resolution in \
db("""SELECT summary, description, reporter, type, id,
- time, status, resolution
+ time, status, resolution
FROM ticket
WHERE (%s id IN (
SELECT id FROM ticket WHERE %s
@@ -157,7 +157,7 @@ class ProductTicketModule(TicketModule):
summary, status, resolution, type)),
from_utimestamp(ts), author,
shorten_result(desc, terms))
-
+
# Attachments
for result in AttachmentModule(self.env).get_search_results(
req, ticket_realm, terms):
@@ -183,8 +183,8 @@ class ProductReportModule(ReportModule):
# FIXME: yield from
for s in super(ProductReportModule, self).get_wiki_syntax():
yield s
- # Previously unmatched prefix
- yield (r"!?\{(?P<prp>%s(?:\s+|(?:%s)))[0-9]+\}" %
+ # Previously unmatched prefix
+ yield (r"!?\{(?P<prp>%s(?:\s+|(?:%s)))[0-9]+\}" %
(IDENTIFIER, PRODUCT_SYNTAX_DELIMITER_RE),
lambda x, y, z: self._format_link(x, 'report', y[1:-1], y, z))
# Absolute product report syntax
@@ -215,7 +215,7 @@ class ProductReportModule(ReportModule):
if not prns:
# Forwarded from _format_link, inherit current context
product_id = fullmatch.group('it_' + ns) or \
- fullmatch.group('prp')
+ fullmatch.group('prp')
if product_id:
product_ns = 'product'
substeps = [product_id.strip()]
@@ -232,8 +232,8 @@ class ProductReportModule(ReportModule):
report_id = fullmatch.group('prid') or \
re.match(r'^.*?(\d+)$', target).group(1)
substeps += [ns, report_id]
-
- return mpsys._format_link(formatter, product_ns,
+
+ return mpsys._format_link(formatter, product_ns,
u':'.join(substeps),
label, fullmatch)
else:
Modified: bloodhound/trunk/bloodhound_multiproduct/multiproduct/util.py
URL: http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/multiproduct/util.py?rev=1566948&r1=1566947&r2=1566948&view=diff
==============================================================================
--- bloodhound/trunk/bloodhound_multiproduct/multiproduct/util.py (original)
+++ bloodhound/trunk/bloodhound_multiproduct/multiproduct/util.py Tue Feb 11 01:52:30 2014
@@ -63,13 +63,13 @@ class ReplacementComponent(Component):
#--------------------------
class EmbeddedLinkFormatter(LinkFormatter):
- """Format the inner TracLinks expression corresponding to resources
+ """Format the inner TracLinks expression corresponding to resources
in compound links e.g. product:PREFIX:ticket:1 , global:ticket:1
"""
def __init__(self, env, context, parent_match=None):
"""Extend initializer signature to accept parent match
-
+
@param parent_match: mapping object containing the following keys
- ns : namespace of parent resolver
- target : target supplied in to parent resolver
@@ -104,7 +104,7 @@ class EmbeddedLinkFormatter(LinkFormatte
if match and not itype in self.wikiparser.helper_patterns:
# Check for preceding escape character '!'
if match[0] == '!':
- # Erroneous expression. Nested link would be escaped
+ # Erroneous expression. Nested link would be escaped
return tag.a(self.parent_match['label'], class_='missing')
if itype in self.wikiparser.external_handlers:
#TODO: Important! Add product prefix in label (when needed?)
@@ -146,7 +146,7 @@ def get_db_connector_from_uri(env):
trac.db.api.DatabaseManager(env).connection_uri
)
return connector
-
+
def using_sqlite_backend(env):
return get_db_connector_from_uri(env) == 'sqlite'
Modified: bloodhound/trunk/bloodhound_multiproduct/multiproduct/versioncontrol.py
URL: http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/multiproduct/versioncontrol.py?rev=1566948&r1=1566947&r2=1566948&view=diff
==============================================================================
--- bloodhound/trunk/bloodhound_multiproduct/multiproduct/versioncontrol.py (original)
+++ bloodhound/trunk/bloodhound_multiproduct/multiproduct/versioncontrol.py Tue Feb 11 01:52:30 2014
@@ -108,4 +108,3 @@ class DbRepositoryProvider(ReplacementCo
trac.versioncontrol.api.DbRepositoryProvider = DbRepositoryProvider
trac.versioncontrol.DbRepositoryProvider = DbRepositoryProvider
-
Modified: bloodhound/trunk/bloodhound_multiproduct/multiproduct/web_ui.py
URL: http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/multiproduct/web_ui.py?rev=1566948&r1=1566947&r2=1566948&view=diff
==============================================================================
--- bloodhound/trunk/bloodhound_multiproduct/multiproduct/web_ui.py (original)
+++ bloodhound/trunk/bloodhound_multiproduct/multiproduct/web_ui.py Tue Feb 11 01:52:30 2014
@@ -53,7 +53,7 @@ class ProductModule(Component):
def pre_process_request(self, req, handler):
if not isinstance(self.env, ProductEnvironment) and \
IGNORED_REQUESTS_RE.match(req.path_info):
- return None
+ return None
return handler
def post_process_request(req, template, data, content_type):
@@ -134,36 +134,36 @@ class ProductModule(Component):
req.perm(product.resource).require('PRODUCT_MODIFY')
else:
req.perm(product.resource).require('PRODUCT_CREATE')
-
+
chrome = Chrome(self.env)
chrome.add_jquery_ui(req)
chrome.add_wiki_toolbars(req)
- data = {'product': product,
+ data = {'product': product,
'context': web_context(req, product.resource)}
return 'product_edit.html', data, None
-
+
def _do_save(self, req, product):
"""common processing for product save events"""
req.perm.require('PRODUCT_VIEW')
-
+
name = req.args.get('name')
prefix = req.args.get('prefix')
description = req.args.get('description', '')
-
+
owner = req.args.get('owner') or req.authname
keys = {'prefix': prefix}
field_data = {'name': name,
'description': description,
'owner': owner,
}
-
+
warnings = []
def warn(msg):
add_warning(req, msg)
warnings.append(msg)
if product._exists:
- if name != product.name and Product.select(self.env,
+ if name != product.name and Product.select(self.env,
where={'name': name}):
warn(_('A product with name "%(name)s" already exists, please '
'choose a different name.', name=name))
@@ -176,7 +176,7 @@ class ProductModule(Component):
add_notice(req, _('Your changes have been saved.'))
else:
req.perm.require('PRODUCT_CREATE')
-
+
if not prefix:
warn(_('You must provide a prefix for the product.'))
elif Product.select(self.env, where={'prefix': prefix}):
@@ -187,7 +187,7 @@ class ProductModule(Component):
elif Product.select(self.env, where={'name': name}):
warn(_('A product with name "%(name)s" already exists, please '
'choose a different name.', name=name))
-
+
if not warnings:
prod = Product(self.env)
prod.update_field_dict(keys)
Modified: bloodhound/trunk/bloodhound_multiproduct/tests/__init__.py
URL: http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/tests/__init__.py?rev=1566948&r1=1566947&r2=1566948&view=diff
==============================================================================
--- bloodhound/trunk/bloodhound_multiproduct/tests/__init__.py (original)
+++ bloodhound/trunk/bloodhound_multiproduct/tests/__init__.py Tue Feb 11 01:52:30 2014
@@ -35,7 +35,7 @@ class TestLoader(unittest.TestLoader):
sortTestMethodsUsing = cmp
suiteClass = unittest.TestSuite
- def discover_package(self, package_or_requirement, pattern='*/test*.py',
+ def discover_package(self, package_or_requirement, pattern='*/test*.py',
ignore_subpkg_root=True, exclude=None):
"""Find and return all test modules from the specified package
directory, recursing into subdirectories to find them. Only test files
@@ -46,7 +46,7 @@ class TestLoader(unittest.TestLoader):
and registered with `pkg_resources` (e.g. via `setup.py develop`).
If a target test module contains a '__testloader__' attribute then
- related object will override current loader for every individual
+ related object will override current loader for every individual
module across the hierarchy.
"""
pending = deque([(package_or_requirement, self, True)])
Modified: bloodhound/trunk/bloodhound_multiproduct/tests/admin/__init__.py
URL: http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/tests/admin/__init__.py?rev=1566948&r1=1566947&r2=1566948&view=diff
==============================================================================
--- bloodhound/trunk/bloodhound_multiproduct/tests/admin/__init__.py (original)
+++ bloodhound/trunk/bloodhound_multiproduct/tests/admin/__init__.py Tue Feb 11 01:52:30 2014
@@ -22,4 +22,3 @@ from tests import TestLoader
def test_suite():
return TestLoader().discover_package(__name__, pattern='*.py')
-
Modified: bloodhound/trunk/bloodhound_multiproduct/tests/admin/console.py
URL: http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/tests/admin/console.py?rev=1566948&r1=1566947&r2=1566948&view=diff
==============================================================================
--- bloodhound/trunk/bloodhound_multiproduct/tests/admin/console.py (original)
+++ bloodhound/trunk/bloodhound_multiproduct/tests/admin/console.py Tue Feb 11 01:52:30 2014
@@ -40,7 +40,7 @@ class ProductTracadminTestCase(Tracadmin
env = getattr(self, '_env', None)
if env is None:
self.global_env = self._setup_test_env(
- enable=('trac.*', 'multiproduct.*'),
+ enable=('trac.*', 'multiproduct.*'),
disable=('trac.tests.*',),
)
self._upgrade_mp(self.global_env)
@@ -96,4 +96,3 @@ def test_suite():
if __name__ == '__main__':
unittest.main(defaultTest='test_suite')
-
Modified: bloodhound/trunk/bloodhound_multiproduct/tests/admin/product_admin.py
URL: http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/tests/admin/product_admin.py?rev=1566948&r1=1566947&r2=1566948&view=diff
==============================================================================
--- bloodhound/trunk/bloodhound_multiproduct/tests/admin/product_admin.py (original)
+++ bloodhound/trunk/bloodhound_multiproduct/tests/admin/product_admin.py Tue Feb 11 01:52:30 2014
@@ -54,11 +54,11 @@ class TestAdminPanel(Component):
yield 'testcat1', 'Test category 1', 'panel1', 'Test panel 1'
yield 'testcat1', 'Test category 1', 'panel2', 'Test panel 2'
yield 'testcat1', 'Test category 1', 'panel3', 'Test panel 3'
-
+
yield 'testcat2', 'Test category 2', 'panel1', 'Test panel 1'
yield 'testcat2', 'Test category 2', 'panel_2', 'Test panel 2'
yield 'testcat2', 'Test category 2', 'panel-3', 'Test panel 3'
-
+
yield 'testcat3', 'Test category 3', 'panel1', 'Test panel 1'
yield 'testcat3', 'Test category 3', 'panel2', 'Test panel 2'
@@ -106,10 +106,10 @@ class BaseProductAdminPanelTestCase(Mult
def setUp(self):
self._mp_setup(enable=[AdminModule, DefaultPermissionPolicy,
DefaultPermissionStore, PermissionSystem,
- PluginAdminPanel, RequestDispatcher,
+ PluginAdminPanel, RequestDispatcher,
api.MultiProductSystem,
product_admin.ProductAdminModule,
- PanelsWhitelist, SectionWhitelist,
+ PanelsWhitelist, SectionWhitelist,
TestAdminPanel, TestPermissionRequestor])
self.global_env = self.env
self.env = ProductEnvironment(self.global_env, self.default_product)
@@ -125,10 +125,10 @@ class BaseProductAdminPanelTestCase(Mult
class ProductAdminSetupTestCase(BaseProductAdminPanelTestCase):
- ALL_PANELS = [('testcat1', 'panel1'), ('testcat1', 'panel2'),
- ('testcat1', 'panel3'), ('testcat2', 'panel_1'),
- ('testcat2', 'panel-2'), ('testcat2', 'panel3'),
- ('testcat3', 'panel1'), ('testcat3', 'panel2'),
+ ALL_PANELS = [('testcat1', 'panel1'), ('testcat1', 'panel2'),
+ ('testcat1', 'panel3'), ('testcat2', 'panel_1'),
+ ('testcat2', 'panel-2'), ('testcat2', 'panel3'),
+ ('testcat3', 'panel1'), ('testcat3', 'panel2'),
('general', 'plugin'), ]
def test_init_whitelist(self):
@@ -137,7 +137,7 @@ class ProductAdminSetupTestCase(BaseProd
('testcat1', 'panel1') : True,
('testcat1', 'panel3'): True,
('testcat2', 'panel3'): True,
- ('general', 'plugin') : True,},
+ ('general', 'plugin') : True,},
self.product_admin.acl)
self.assertTrue(all(not self.global_product_admin._check_panel(c, p)
for c, p in self.ALL_PANELS))
@@ -153,9 +153,9 @@ class ProductAdminSetupTestCase(BaseProd
self.assertFalse(self.product_admin._check_panel('other', 'panel'))
def test_init_blacklist(self):
- self.global_env.config.set('multiproduct', 'admin_blacklist',
+ self.global_env.config.set('multiproduct', 'admin_blacklist',
'testcat1:panel1,testcat3:panel2')
- self.env.config.set('multiproduct', 'admin_blacklist',
+ self.env.config.set('multiproduct', 'admin_blacklist',
'testcat1:panel3,testcat3:panel1,testcat2:*')
self.assertEqual(['testcat1:panel1','testcat3:panel2'],
@@ -170,7 +170,7 @@ class ProductAdminSetupTestCase(BaseProd
('testcat1', 'panel3'): False,
('testcat2', 'panel3'): True,
('testcat3', 'panel1'): False,
- ('general', 'plugin'): True,},
+ ('general', 'plugin'): True,},
self.product_admin.acl)
self.assertTrue(all(not self.global_product_admin._check_panel(c, p)
@@ -192,9 +192,9 @@ class ProductAdminDispatchTestCase(BaseP
def setUp(self):
BaseProductAdminPanelTestCase.setUp(self)
- self.global_env.config.set('multiproduct', 'admin_blacklist',
+ self.global_env.config.set('multiproduct', 'admin_blacklist',
'testcat1:panel1,testcat3:panel2')
- self.env.config.set('multiproduct', 'admin_blacklist',
+ self.env.config.set('multiproduct', 'admin_blacklist',
'testcat1:panel3,testcat3:panel1,testcat2:*')
global_permsys = PermissionSystem(self.global_env)
permsys = PermissionSystem(self.env)
@@ -502,4 +502,3 @@ def test_suite():
if __name__ == '__main__':
unittest.main(defaultTest='test_suite')
-
Modified: bloodhound/trunk/bloodhound_multiproduct/tests/attachment.py
URL: http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/tests/attachment.py?rev=1566948&r1=1566947&r2=1566948&view=diff
==============================================================================
--- bloodhound/trunk/bloodhound_multiproduct/tests/attachment.py (original)
+++ bloodhound/trunk/bloodhound_multiproduct/tests/attachment.py Tue Feb 11 01:52:30 2014
@@ -68,4 +68,3 @@ def test_suite():
if __name__ == '__main__':
unittest.main(defaultTest='test_suite')
-
Modified: bloodhound/trunk/bloodhound_multiproduct/tests/config.py
URL: http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/tests/config.py?rev=1566948&r1=1566947&r2=1566948&view=diff
==============================================================================
--- bloodhound/trunk/bloodhound_multiproduct/tests/config.py (original)
+++ bloodhound/trunk/bloodhound_multiproduct/tests/config.py Tue Feb 11 01:52:30 2014
@@ -82,13 +82,13 @@ class MultiproductConfigTestCase(Multipr
parser.readfp(fp, 'bh-product-test')
with self.env.db_transaction as db:
# Delete existing setting for target product , if any
- for setting in ProductSetting.select(self.env, db,
+ for setting in ProductSetting.select(self.env, db,
{'product' : product}):
setting.delete()
# Insert new options
for section in parser.sections():
option_key = dict(
- section=to_unicode(section),
+ section=to_unicode(section),
product=to_unicode(product)
)
for option, value in parser.items(section):
@@ -121,7 +121,7 @@ class MultiproductConfigTestCase(Multipr
def _dump_settings(self, config):
product = config.product
fields = ('section', 'option', 'value')
- rows = [tuple(getattr(s, f, None) for f in fields) for s in
+ rows = [tuple(getattr(s, f, None) for f in fields) for s in
ProductSetting.select(config.env, where={'product' : product})]
dump = []
@@ -133,10 +133,10 @@ class MultiproductConfigTestCase(Multipr
class ProductConfigTestCase(MultiproductConfigTestCase, ConfigurationTestCase):
- r"""Test cases for Trac configuration objects rewritten for product
+ r"""Test cases for Trac configuration objects rewritten for product
scope.
"""
- # Test cases rewritten to avoid reading config file.
+ # Test cases rewritten to avoid reading config file.
# It does make sense for product config as it's stored in the database
def test_set_and_save(self):
@@ -155,12 +155,12 @@ class ProductConfigTestCase(Multiproduct
dump = self._dump_settings(config)
self.assertEquals([
u'[aä]\n',
- u"option1 = Voilà l'été\n",
- u"option2 = Voilà l'été\n",
- u'öption0 = x\n',
- # u"option3 = Voilàl'été\n",
+ u"option1 = Voilà l'été\n",
+ u"option2 = Voilà l'été\n",
+ u'öption0 = x\n',
+ # u"option3 = Voilàl'été\n",
u'[b]\n',
- u'öption0 = y\n',
+ u'öption0 = y\n',
],
dump)
config2 = self._read()
@@ -182,10 +182,10 @@ class ProductConfigTestCase(Multiproduct
dump = self._dump_settings(config)
self.assertEquals([
u'[a]\n',
- u"option1 = Voilà l'été\n",
- u"option2 = Voilà l'été\n",
+ u"option1 = Voilà l'été\n",
+ u"option2 = Voilà l'été\n",
u'[inherit]\n',
- u"file = trac-site.ini\n",
+ u"file = trac-site.ini\n",
],
dump)
config2 = self._read()
@@ -260,4 +260,3 @@ def test_suite():
if __name__ == '__main__':
unittest.main(defaultTest='test_suite')
-
Modified: bloodhound/trunk/bloodhound_multiproduct/tests/db/__init__.py
URL: http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/tests/db/__init__.py?rev=1566948&r1=1566947&r2=1566948&view=diff
==============================================================================
--- bloodhound/trunk/bloodhound_multiproduct/tests/db/__init__.py (original)
+++ bloodhound/trunk/bloodhound_multiproduct/tests/db/__init__.py Tue Feb 11 01:52:30 2014
@@ -20,4 +20,3 @@ from tests import TestLoader
def test_suite():
return TestLoader().discover_package(__name__, pattern='*.py')
-
Modified: bloodhound/trunk/bloodhound_multiproduct/tests/db/cursor.py
URL: http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/tests/db/cursor.py?rev=1566948&r1=1566947&r2=1566948&view=diff
==============================================================================
--- bloodhound/trunk/bloodhound_multiproduct/tests/db/cursor.py (original)
+++ bloodhound/trunk/bloodhound_multiproduct/tests/db/cursor.py Tue Feb 11 01:52:30 2014
@@ -1057,5 +1057,3 @@ class DbCursorTestCase(unittest.TestCase
if __name__ == '__main__':
unittest.main()
-
-
Modified: bloodhound/trunk/bloodhound_multiproduct/tests/env.py
URL: http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/tests/env.py?rev=1566948&r1=1566947&r2=1566948&view=diff
==============================================================================
--- bloodhound/trunk/bloodhound_multiproduct/tests/env.py (original)
+++ bloodhound/trunk/bloodhound_multiproduct/tests/env.py Tue Feb 11 01:52:30 2014
@@ -89,7 +89,7 @@ class MultiproductTestCase(unittest.Test
return _AssertRaisesContext.__exit__(self, exc_type,
exc_value, tb)
except self.failureException, exc:
- msg = self.test_case.exceptFailureMessage
+ msg = self.test_case.exceptFailureMessage
if msg is not None:
standardMsg = str(exc)
msg = msg % self._tb_locals(tb)
@@ -156,7 +156,7 @@ class MultiproductTestCase(unittest.Test
# Test setup
def _setup_test_env(self, create_folder=True, path=None, **kwargs):
- r"""Prepare a new test environment .
+ r"""Prepare a new test environment .
Optionally set its path to a meaningful location (temp folder
if `path` is `None`).
@@ -199,7 +199,7 @@ class MultiproductTestCase(unittest.Test
# Clean-up logger instance and associated handler
# Otherwise large test suites will only result in ERROR eventually
- # (at least in Unix systems) with messages
+ # (at least in Unix systems) with messages
#
# TracError: Error reading '/path/to/file', make sure it is readable.
# error: /path/to/: Too many open files
@@ -336,7 +336,7 @@ class ProductEnvApiTestCase(Multiproduct
def property_mock(attrnm, expected_self):
def assertAttrFwd(instance):
- self.assertIs(instance, expected_self,
+ self.assertIs(instance, expected_self,
"Mismatch in property '%s'" % (attrnm,))
raise AttrSuccess
return property(assertAttrFwd)
@@ -346,7 +346,7 @@ class ProductEnvApiTestCase(Multiproduct
for attrnm in 'system_info_providers secure_cookies ' \
'project_admin_trac_url get_system_info get_version ' \
'get_templates_dir get_templates_dir get_log_dir ' \
- 'backup'.split():
+ 'backup'.split():
original = getattr(Environment, attrnm)
if isinstance(original, MethodType):
translation = getattr(self.product_env, attrnm)
@@ -519,24 +519,24 @@ class ProductEnvApiTestCase(Multiproduct
self.assertEquals('value2', product_config['section'].get('key'))
def test_parametric_singleton(self):
- self.assertIs(self.product_env,
+ self.assertIs(self.product_env,
ProductEnvironment(self.env, self.default_product))
for prefix in self.PRODUCT_DATA:
if prefix != self.default_product:
self._load_product_from_data(self.env, prefix)
- envgen1 = dict([prefix, ProductEnvironment(self.env, prefix)]
+ envgen1 = dict([prefix, ProductEnvironment(self.env, prefix)]
for prefix in self.PRODUCT_DATA)
- envgen2 = dict([prefix, ProductEnvironment(self.env, prefix)]
+ envgen2 = dict([prefix, ProductEnvironment(self.env, prefix)]
for prefix in self.PRODUCT_DATA)
for prefix, env1 in envgen1.iteritems():
- self.assertIs(env1, envgen2[prefix],
+ self.assertIs(env1, envgen2[prefix],
"Identity check (by prefix) '%s'" % (prefix,))
for prefix, env1 in envgen1.iteritems():
- self.assertIs(env1, envgen2[prefix],
+ self.assertIs(env1, envgen2[prefix],
"Identity check (by prefix) '%s'" % (prefix,))
def load_product(prefix):
@@ -551,12 +551,12 @@ class ProductEnvApiTestCase(Multiproduct
for prefix in self.PRODUCT_DATA)
for prefix, env1 in envgen1.iteritems():
- self.assertIs(env1, envgen3[prefix],
+ self.assertIs(env1, envgen3[prefix],
"Identity check (by product model) '%s'" % (prefix,))
class ProductEnvHrefTestCase(MultiproductTestCase):
- """Assertions for resolution of product environment's base URL
+ """Assertions for resolution of product environment's base URL
[https://issues.apache.org/bloodhound/wiki/Proposals/BEP-0003 BEP 3]
"""
@@ -690,7 +690,7 @@ class ProductEnvConfigTestCase(Multiprod
class DummyAdminCommand(Component):
"""Dummy class used for testing purposes
"""
- implements(IAdminCommandProvider)
+ implements(IAdminCommandProvider)
class DummyException(Exception):
pass
@@ -748,7 +748,7 @@ class ProductEnvConfigTestCase(Multiprod
try:
# It is necessary to load another environment object to work around
# ProductEnvironment class' parametric singleton constraint
- old_env = self.env
+ old_env = self.env
# In-memory DB has to be shared
self.global_env.__class__.global_databasemanager = \
self.env.global_databasemanager
@@ -756,12 +756,12 @@ class ProductEnvConfigTestCase(Multiprod
path=self.global_env.path)
self.env = old_env
self._setup_test_log(new_global_env)
-
+
# FIXME: EnvironmentStub config is not bound to a real file
# ... so let's reuse one config for both envs to simulate that they
# are in sync, a condition verified in another test case
new_global_env.config = self.global_env.config
-
+
new_env = ProductEnvironment(new_global_env, self.default_product)
self.assertTrue(new_global_env is not self.global_env)
@@ -769,10 +769,10 @@ class ProductEnvConfigTestCase(Multiprod
self.assertEqual(self.env.path, new_env.path)
self.assertEqual(self.env.config._lock_path,
new_env.config._lock_path)
-
+
tracadmin = AdminCommandManager(self.env)
new_tracadmin = AdminCommandManager(new_env)
-
+
# Assertions for self.env
self.assertTrue(self.env[self.component_class] is None,
"Expected component disabled")
@@ -781,7 +781,7 @@ class ProductEnvConfigTestCase(Multiprod
"Component erroneously listed in admin cmd "
"providers")
self.assertEqual([], tracadmin.get_command_help(args=['fail']))
-
+
# Repeat assertions for new_env
self.assertTrue(new_env[self.component_class] is None,
"Expected component disabled")
@@ -790,13 +790,13 @@ class ProductEnvConfigTestCase(Multiprod
"Component erroneously listed in admin cmd "
"providers")
self.assertEqual([], new_tracadmin.get_command_help(args=['fail']))
-
+
# Enable component in both self.global_env and self.env contexts
cmd_args = ['config', 'set', 'components',
__name__ + '.*', 'enabled']
AdminCommandManager(self.global_env).execute_command(*cmd_args)
tracadmin.execute_command(*cmd_args)
-
+
# Assert that changes are auto-magically reflected in new_env
self.assertTrue(new_env[self.component_class] is not None,
"Expected component enabled")
Modified: bloodhound/trunk/bloodhound_multiproduct/tests/functional/__init__.py
URL: http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/tests/functional/__init__.py?rev=1566948&r1=1566947&r2=1566948&view=diff
==============================================================================
--- bloodhound/trunk/bloodhound_multiproduct/tests/functional/__init__.py (original)
+++ bloodhound/trunk/bloodhound_multiproduct/tests/functional/__init__.py Tue Feb 11 01:52:30 2014
@@ -59,7 +59,7 @@ class MultiproductFunctionalMixin(object
"""Mixin class applying multi-product upgrade path upon a given
functional Trac test environment. Access to the global environment
is provided at testing time. In order to obtain a compatible test
- environment for a given product @see: `product_test_env` method
+ environment for a given product @see: `product_test_env` method
@attention: This class must precede functional test environment class in
class declaration because it overrides some methods
@@ -74,9 +74,9 @@ class MultiproductFunctionalMixin(object
"""
self.bh_install_project = 'trac'
self.bhmp_upgrade = False
- self.trac_src = os.path.realpath(os.path.join(
+ self.trac_src = os.path.realpath(os.path.join(
__import__('trac', []).__file__, '..' , '..'))
- self.bh_src = os.path.realpath(os.path.join(
+ self.bh_src = os.path.realpath(os.path.join(
__import__('multiproduct', []).__file__, '..' , '..', '..'))
self.htdigest = os.path.join(self.dirname, "htdigest")
self.htdigest_realm = 'bloodhound'
@@ -110,13 +110,13 @@ class MultiproductFunctionalMixin(object
self.post_create(env)
def adduser_htpasswd(self, user):
- """Add a user to the environment. The password will be set
+ """Add a user to the environment. The password will be set
in htpasswd file to the same as username.
"""
- return super(MultiproductFunctionalMixin, self).adduser(user)
+ return super(MultiproductFunctionalMixin, self).adduser(user)
def adduser_htdigest(self, user):
- """Add a user to the environment. The password will be set
+ """Add a user to the environment. The password will be set
in htdigest file to the same as username.
"""
if call([sys.executable, os.path.join(self.trac_src, 'contrib',
@@ -141,7 +141,7 @@ class MultiproductFunctionalMixin(object
return Href('%s://%s:%s@%s/' % (parts[0], user, user, parts[1]))
def get_enabled_components(self):
- """Also enable Bloodhound multiproduct plugin.
+ """Also enable Bloodhound multiproduct plugin.
"""
return super(MultiproductFunctionalMixin, self).get_enabled_components() + \
['multiproduct.*']
@@ -156,7 +156,7 @@ class MultiproductFunctionalMixin(object
super(MultiproductFunctionalMixin, self).post_create(env)
- def _tracadmin(self, *args, **kwargs):
+ def _tracadmin(self, *args, **kwargs):
"""Execute trac-admin command in product or (by default) global context
"""
do_wait = kwargs.pop('wait', False)
@@ -179,7 +179,7 @@ class MultiproductFunctionalMixin(object
def start(self):
"""Starts the webserver, and waits for it to come up.
-
+
Notice: Same as inherited method but without basic auth by default
"""
if 'FIGLEAF' in os.environ:
@@ -241,7 +241,7 @@ class MultiproductFunctionalMixin(object
"""Setup web bootstrap_handlers and generation of product and global
base URLs for a given user
- :return: a function used to generate base URL for product and
+ :return: a function used to generate base URL for product and
global environments . It will satisfy the following signature
`base_url(user=None, prefix=None, envname=None)` where::
@@ -254,7 +254,7 @@ class MultiproductFunctionalMixin(object
parent directory
Generated URLs must be consistent with web hooks configuration
- @see: `_configure_web_hooks` method . By default `envname` is ignored
+ @see: `_configure_web_hooks` method . By default `envname` is ignored
and product base URL will be at /products under URL namespace of the
global environment.
"""
@@ -266,7 +266,7 @@ class MultiproductFunctionalMixin(object
if not user or user == 'anonymous':
global_href = Href('%s://%s/' % (parts[0], parts[1]))
else:
- global_href = Href('%s://%s:%s@%s/' %
+ global_href = Href('%s://%s:%s@%s/' %
(parts[0], user, user, parts[1]))
# FIXME : Check that prefix is None is correct
return global_href if (prefix is None or prefix == GLOBAL_ENV) \
@@ -280,7 +280,7 @@ class MultiproductFunctionalMixin(object
def _bloodhound_install_args(self):
"""Determine arguments supplied in to Bloodhound installer.
"""
- return dict(adminuser='admin', adminpass='admin',
+ return dict(adminuser='admin', adminpass='admin',
dbstring=self.dburi, default_product_prefix='test',
digestfile=self.htdigest, realm=self.htdigest_realm,
repo_type=self.repotype,
@@ -354,7 +354,7 @@ class FunctionalProductEnvironment(objec
self.url = self.parent.get_env_href(prefix=product_id)
ProductEnvironment(testenv.get_trac_environment(), self.prefix)
- def _tracadmin(self, *args, **kwargs):
+ def _tracadmin(self, *args, **kwargs):
"""Execute trac-admin command in target product context by default
"""
product_id = kwargs.get('product')
@@ -378,7 +378,7 @@ class FunctionalProductEnvironment(objec
raise AttributeError
return getattr(self.parent, attrnm)
except AttributeError:
- raise AttributeError("'%s' object has no attribute '%s'" %
+ raise AttributeError("'%s' object has no attribute '%s'" %
(self.__class__.__name__, attrnm))
@@ -414,10 +414,10 @@ class BloodhoundFunctionalTester(Functio
- 'New Ticket' link has been phased out in favor of 'More fields' link in
quick create ticket shortcut menu.
- - New helper method `quick_create_ticket` has been added to create a
+ - New helper method `quick_create_ticket` has been added to create a
new (random) ticket via quick create ticket shortcut menu.
- 'logged in as user' label replaced by '<i class="icon-user"></i>user'
- - By using account manager plugin a web form must be submitted to login
+ - By using account manager plugin a web form must be submitted to login
- As a consequence of default hooks new tickets in global scope are
always bound to default product
- Timeline module is disabled; frequently used along functional tests
@@ -432,11 +432,11 @@ class BloodhoundFunctionalTester(Functio
- Preferences link removed in Bloodhound UI
- There's no such thing like ticket preview in Bloodhound UI
- 'Create New Ticket' label in new ticket page replaced by 'New Ticket'
- - Ticket owner label changed from 'Owned by' to 'Assigned to'
+ - Ticket owner label changed from 'Owned by' to 'Assigned to'
- Source files (*.py) files copied in /plugins folder not enabled ootb
- Twitter Bootstrap class="input-mini" added in 'Max items per page'
input control in query view.
- - Ticket comment header changed
+ - Ticket comment header changed
- 'Page PageName created' is not shown anymore for new wiki page
- Ticket workflow <select /> does not end with `id` attribute
- Ticket events in timeline are different i.e. 'by user' outside <a />
@@ -451,9 +451,9 @@ class BloodhoundFunctionalTester(Functio
"""
def __init__(self, url, skiplogin=False, instance_state=None):
- """Create a :class:`BloodhoundFunctionalTester` for the given
+ """Create a :class:`BloodhoundFunctionalTester` for the given
environment URL and Subversion URL
-
+
:param skiplogin: Skip admin user login
"""
self.url = url
@@ -539,8 +539,8 @@ class BloodhoundFunctionalTester(Functio
if info:
for field, value in info.items():
tc.formvalue('propertyform', 'field_%s' % field, value)
-
- # [BLOODHOUND] no actual button to submit /newticket `propertyform`
+
+ # [BLOODHOUND] no actual button to submit /newticket `propertyform`
tc.submit()
self._post_create_ticket()
@@ -686,7 +686,7 @@ class BloodhoundFunctionalTester(Functio
tc.find(self.regex_query_column_selector(fieldname, fieldlbl), 's')
def as_user(self, user, restore='admin'):
- """Context manager to track access to the web site
+ """Context manager to track access to the web site
as user and restore login afterwards (by default to admin)
"""
@contextlib.contextmanager
@@ -733,7 +733,7 @@ class BloodhoundFunctionalTester(Functio
def __exit__(self, exc_type, exc_value, traceback):
"""Restore tester URL poiting at global environment
"""
- self.tester.url = self.prev_url
+ self.tester.url = self.prev_url
def create_product(self, prefix=None, name=None, desc=None):
"""Create a product from the product list page."""
@@ -814,7 +814,7 @@ class BloodhoundGlobalEnvFunctionalTeste
default_product_url = tester.default_product_url
tester = BloodhoundFunctionalTester(tester.url, True,
tester._state)
- tester.default_product_url = default_product_url
+ tester.default_product_url = default_product_url
super(self.__class__, self).__init__(tester, url)
def _post_create_ticket(self):
@@ -829,7 +829,7 @@ class BloodhoundGlobalEnvFunctionalTeste
"""Creates the specified milestone, with a random name if none is
provided. Returns the name of the milestone.
- ... executed in default product context
+ ... executed in default product context
"""
superobj = super(BloodhoundGlobalEnvFunctionalTester, self)
with self.in_product(self):
@@ -839,7 +839,7 @@ class BloodhoundGlobalEnvFunctionalTeste
"""Creates the specified component, with a random camel-cased name if
none is provided. Returns the name.
- ... executed in default product context
+ ... executed in default product context
"""
superobj = super(BloodhoundGlobalEnvFunctionalTester, self)
with self.in_product(self):
@@ -850,7 +850,7 @@ class BloodhoundGlobalEnvFunctionalTeste
``severity``, etc). If no name is given, a unique random word is used.
The name is returned.
- ... executed in default product context
+ ... executed in default product context
"""
superobj = super(BloodhoundGlobalEnvFunctionalTester, self)
@@ -861,7 +861,7 @@ class BloodhoundGlobalEnvFunctionalTeste
"""Create a new version. The name defaults to a random camel-cased
word if not provided.
- ... executed in default product context
+ ... executed in default product context
"""
superobj = super(BloodhoundGlobalEnvFunctionalTester, self)
with self.in_product(self):
@@ -917,7 +917,7 @@ class MultiproductFunctionalTestSuite(fu
and dashboard plugins.
"""
- class env_class(MultiproductFunctionalMixin,
+ class env_class(MultiproductFunctionalMixin,
functional.FunctionalTestSuite.env_class):
pass
@@ -1034,7 +1034,7 @@ import trac.ticket.tests.functional
import trac.admin.tests.functional
from trac.tests.functional import testcases
-ignore_tc = (functional.FunctionalTwillTestCaseSetup,
+ignore_tc = (functional.FunctionalTwillTestCaseSetup,
functional.FunctionalTestCaseSetup)
for mdl in (trac.ticket.tests.functional, trac.admin.tests.functional):
for attr in dir(mdl):
Modified: bloodhound/trunk/bloodhound_multiproduct/tests/functional/prefs.py
URL: http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/tests/functional/prefs.py?rev=1566948&r1=1566947&r2=1566948&view=diff
==============================================================================
--- bloodhound/trunk/bloodhound_multiproduct/tests/functional/prefs.py (original)
+++ bloodhound/trunk/bloodhound_multiproduct/tests/functional/prefs.py Tue Feb 11 01:52:30 2014
@@ -21,7 +21,7 @@ from trac.tests import functional
from trac.tests.functional.tester import tc
#----------------
-# Functional test cases for preferences (rewritten)
+# Functional test cases for preferences (rewritten)
#----------------
# TODO: These classes are almost a copycat of Trac's. Beware of license header
Modified: bloodhound/trunk/bloodhound_multiproduct/tests/functional/product.py
URL: http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/tests/functional/product.py?rev=1566948&r1=1566947&r2=1566948&view=diff
==============================================================================
--- bloodhound/trunk/bloodhound_multiproduct/tests/functional/product.py (original)
+++ bloodhound/trunk/bloodhound_multiproduct/tests/functional/product.py Tue Feb 11 01:52:30 2014
@@ -47,7 +47,7 @@ class TestNewProduct(FunctionalTwillTest
tc.find('<a[^>]*>Index by Title')
-class TestProductRenameAuthor(MultiproductFunctionalTestCase,
+class TestProductRenameAuthor(MultiproductFunctionalTestCase,
FunctionalTwillTestCaseSetup):
def runTest(self):
"""Check for correct author in ticket comments on product rename
Modified: bloodhound/trunk/bloodhound_multiproduct/tests/functional/ticket.py
URL: http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/tests/functional/ticket.py?rev=1566948&r1=1566947&r2=1566948&view=diff
==============================================================================
--- bloodhound/trunk/bloodhound_multiproduct/tests/functional/ticket.py (original)
+++ bloodhound/trunk/bloodhound_multiproduct/tests/functional/ticket.py Tue Feb 11 01:52:30 2014
@@ -30,7 +30,7 @@ from tests import unittest
from tests.functional import regex_owned_by
#----------------
-# Functional test cases for tickets (rewritten)
+# Functional test cases for tickets (rewritten)
#----------------
# TODO: These classes are almost a copycat of Trac's. Beware of license header
@@ -65,18 +65,18 @@ class TestTicketNoSummary(FunctionalTwil
desc = random_sentence(5)
tc.formvalue('propertyform', 'field-description', desc)
- # [BLOODHOUND] no actual button to submit /newticket `propertyform`
+ # [BLOODHOUND] no actual button to submit /newticket `propertyform`
tc.submit()
tc.find(desc)
tc.find('Tickets must contain a summary.')
- # [BLOODHOUND] Create New Ticket => New Ticket
+ # [BLOODHOUND] Create New Ticket => New Ticket
tc.find('New Ticket')
tc.find('ticket not yet created')
class TestTicketCustomFieldTextNoFormat(FunctionalTwillTestCaseSetup):
BH_IN_DEFAULT_PRODUCT = True
-
+
def runTest(self):
"""Test custom text field with no format explicitly specified.
Its contents should be rendered as plain text.
@@ -95,12 +95,12 @@ class TestTicketCustomFieldTextNoFormat(
self._tester.go_to_ticket(ticketid)
# [BLOODHOUND] Different markup to render field values
- self._tester.find_ticket_field('newfield', val)
+ self._tester.find_ticket_field('newfield', val)
class TestTicketCustomFieldTextAreaNoFormat(FunctionalTwillTestCaseSetup):
BH_IN_DEFAULT_PRODUCT = True
-
+
def runTest(self):
"""Test custom textarea field with no format explicitly specified,
its contents should be rendered as plain text.
@@ -124,7 +124,7 @@ class TestTicketCustomFieldTextAreaNoFor
class TestTicketCustomFieldTextWikiFormat(FunctionalTwillTestCaseSetup):
BH_IN_DEFAULT_PRODUCT = True
-
+
def runTest(self):
"""Test custom text field with `wiki` format.
Its contents should through the wiki engine, wiki-links and all.
@@ -147,12 +147,12 @@ class TestTicketCustomFieldTextWikiForma
wiki = '<a [^>]*>%s\??</a> %s' % (word1, word2)
# [BLOODHOUND] Different markup to render field values
- self._tester.find_ticket_field('newfield', wiki)
+ self._tester.find_ticket_field('newfield', wiki)
class TestTicketCustomFieldTextAreaWikiFormat(FunctionalTwillTestCaseSetup):
BH_IN_DEFAULT_PRODUCT = True
-
+
def runTest(self):
"""Test custom textarea field with no format explicitly specified,
its contents should be rendered as plain text.
@@ -174,7 +174,7 @@ class TestTicketCustomFieldTextAreaWikiF
wiki = '<p>\s*<a [^>]*>%s\??</a> %s<br />\s*</p>' % (word1, word2)
# [BLOODHOUND] Different markup to render field values
- self._tester.find_ticket_field('newfield', wiki)
+ self._tester.find_ticket_field('newfield', wiki)
class TestTicketCustomFieldTextReferenceFormat(FunctionalTwillTestCaseSetup):
@@ -208,7 +208,7 @@ class TestTicketCustomFieldTextReference
querylink = '<a href="%s/query\?%s">%s</a>' % (path_prefix, query, val)
# [BLOODHOUND] Different markup to render field values
- self._tester.find_ticket_field('newfield', querylink)
+ self._tester.find_ticket_field('newfield', querylink)
class TestTicketCustomFieldTextListFormat(FunctionalTwillTestCaseSetup):
@@ -247,7 +247,7 @@ class TestTicketCustomFieldTextListForma
querylinks = '%s %s' % (querylink1, querylink2)
# [BLOODHOUND] Different markup to render field values
- self._tester.find_ticket_field('newfield', querylinks)
+ self._tester.find_ticket_field('newfield', querylinks)
class RegressionTestTicket10828(FunctionalTwillTestCaseSetup):
@@ -300,7 +300,7 @@ class RegressionTestTicket10828(Function
query2 = 'status=!closed&newfield=~%s' % word2
query3 = 'status=!closed&newfield=~%s' % word3
-
+
path_prefix = urlsplit(self._tester.url).path
querylink1 = '<a href="%s/query\?%s">%s</a>' % (path_prefix,
query1, word1)
@@ -311,12 +311,12 @@ class RegressionTestTicket10828(Function
querylinks = '%s %s, %s' % (querylink1, querylink2, querylink3)
# [BLOODHOUND] Different markup to render field values
- self._tester.find_ticket_field('newfield', querylinks)
+ self._tester.find_ticket_field('newfield', querylinks)
class RegressionTestTicket5394a(FunctionalTwillTestCaseSetup):
BH_IN_DEFAULT_PRODUCT = True
-
+
def runTest(self):
"""Test for regression of http://trac.edgewall.org/ticket/5394 a
Order user list alphabetically in (re)assign action
@@ -382,7 +382,7 @@ class RegressionTestTicket5394b(Function
# FIXME: Verbatim copy of its peer just to override regex_owned_by
class RegressionTestTicket5497a(FunctionalTwillTestCaseSetup):
BH_IN_DEFAULT_PRODUCT = True
-
+
def runTest(self):
"""Test for regression of http://trac.edgewall.org/ticket/5497 a
Open ticket, component changed, owner not changed"""
@@ -396,7 +396,7 @@ class RegressionTestTicket5497a(Function
# FIXME: Verbatim copy of its peer just to override regex_owned_by
class RegressionTestTicket5497b(FunctionalTwillTestCaseSetup):
BH_IN_DEFAULT_PRODUCT = True
-
+
def runTest(self):
"""Test for regression of http://trac.edgewall.org/ticket/5497 b
Open ticket, component changed, owner changed"""
@@ -413,7 +413,7 @@ class RegressionTestTicket5497b(Function
# FIXME: Verbatim copy of its peer just to override regex_owned_by
class RegressionTestTicket5497c(FunctionalTwillTestCaseSetup):
BH_IN_DEFAULT_PRODUCT = True
-
+
def runTest(self):
"""Test for regression of http://trac.edgewall.org/ticket/5497 c
New ticket, component changed, owner not changed"""
@@ -426,7 +426,7 @@ class RegressionTestTicket5497c(Function
# FIXME: Verbatim copy of its peer just to override regex_owned_by
class RegressionTestTicket5497d(FunctionalTwillTestCaseSetup):
BH_IN_DEFAULT_PRODUCT = True
-
+
def runTest(self):
"""Test for regression of http://trac.edgewall.org/ticket/5497 d
New ticket, component changed, owner changed"""
@@ -455,7 +455,7 @@ class RegressionTestRev5994(FunctionalTw
class RegressionTestTicket6048(FunctionalTwillTestCaseSetup):
BH_IN_DEFAULT_PRODUCT = True
-
+
def runTest(self):
"""Test for regression of http://trac.edgewall.org/ticket/6048"""
# Setup the DeleteTicket plugin
@@ -566,7 +566,7 @@ class RegressionTestTicket8247(Functiona
tc.submit('remove')
tc.go(ticket_url)
- # [BLOODHOUND] Ticket comment header changed
+ # [BLOODHOUND] Ticket comment header changed
tc.find('<strong class="trac-field-milestone">Milestone</strong>'
'[ \n\t]*<span>[ \n\t]*<em>%s</em> deleted' % name)
tc.find('by admin<span>, <a.* ago</a></span>')
@@ -592,8 +592,8 @@ class TestTimelineTicketDetails(Function
htmltags = '(<[^>]*>)*'
# [BLOODHOUND] Ticket events are different i.e. 'by user' outside <a />
- tc.find(htmltags + 'Ticket ' + htmltags + '#' + str(ticketid) +
- htmltags + ' \\(' + summary + '\\) updated\\s*' +
+ tc.find(htmltags + 'Ticket ' + htmltags + '#' + str(ticketid) +
+ htmltags + ' \\(' + summary + '\\) updated\\s*' +
htmltags + '\\s+by\\s+' + htmltags + 'admin', 's')
@@ -659,12 +659,12 @@ class RegressionTestTicket5602(Functiona
tc.go(self._tester.url + "/roadmap")
tc.follow(milestone)
- # [BLOODHOUND] closed: labels in milestone progress bar removed
+ # [BLOODHOUND] closed: labels in milestone progress bar removed
tc.follow(r"/query\?.*status=closed&.*milestone=%s$" % (milestone,))
tc.find("Resolution:[ \t\n]+fixed")
tc.back()
- # [BLOODHOUND] active: labels in milestone progress bar removed
+ # [BLOODHOUND] active: labels in milestone progress bar removed
tc.follow(r"/query\?.*status=new&.*milestone=%s$" % (milestone,))
tc.find("Status:[ \t\n]+new")
tc.find("Status:[ \t\n]+assigned")
@@ -689,10 +689,10 @@ class RegressionTestTicket9084(Functiona
tc.notfind('AssertionError')
-class RegressionTestTicket6879a(FunctionalTwillTestCaseSetup,
+class RegressionTestTicket6879a(FunctionalTwillTestCaseSetup,
unittest.TestCase):
BH_IN_DEFAULT_PRODUCT = True
-
+
def runTest(self):
"""Test for regression of http://trac.edgewall.org/ticket/6879 a
@@ -715,10 +715,10 @@ class RegressionTestTicket6879a(Function
tc.submit('preview')
-class RegressionTestTicket6879b(FunctionalTwillTestCaseSetup,
+class RegressionTestTicket6879b(FunctionalTwillTestCaseSetup,
unittest.TestCase):
BH_IN_DEFAULT_PRODUCT = True
-
+
def runTest(self):
"""Test for regression of http://trac.edgewall.org/ticket/6879 b
@@ -731,7 +731,7 @@ class RegressionTestTicket6879b(Function
tc.formvalue('propertyform', 'action', 'resolve')
tc.formvalue('propertyform', 'action_resolve_resolve_resolution', 'fixed')
- # [BLOODHOUND] No preview button for ticket (comments) in BH theme
+ # [BLOODHOUND] No preview button for ticket (comments) in BH theme
try:
tc.submit('preview')
except TwillException:
@@ -743,11 +743,11 @@ class RegressionTestTicket6879b(Function
class TestAdminPriorityRenumber(FunctionalTwillTestCaseSetup):
BH_IN_DEFAULT_PRODUCT = True
-
+
def runTest(self):
"""Admin renumber priorities"""
- # [BLOODHOUND] class="input-mini" appended to priorities <select />
+ # [BLOODHOUND] class="input-mini" appended to priorities <select />
valuesRE = re.compile('<select name="value_([0-9]+)".*>', re.M)
html = b.get_html()
@@ -782,7 +782,7 @@ def trac_functionalSuite(suite=None):
suite.addTest(TestTicketTabFormat())
suite.addTest(TestTicketRSSFormat())
- # [BLOODHOUND] TODO: Move to BloodhoundSearch plugin
+ # [BLOODHOUND] TODO: Move to BloodhoundSearch plugin
# suite.addTest(TestTicketSearch())
# suite.addTest(TestNonTicketSearch())
@@ -894,4 +894,3 @@ def functionalSuite(suite=None):
if __name__ == '__main__':
import unittest
unittest.main(defaultTest='functionalSuite')
-
Modified: bloodhound/trunk/bloodhound_multiproduct/tests/mimeview/api.py
URL: http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/tests/mimeview/api.py?rev=1566948&r1=1566947&r2=1566948&view=diff
==============================================================================
--- bloodhound/trunk/bloodhound_multiproduct/tests/mimeview/api.py (original)
+++ bloodhound/trunk/bloodhound_multiproduct/tests/mimeview/api.py Tue Feb 11 01:52:30 2014
@@ -60,4 +60,3 @@ def test_suite():
if __name__ == '__main__':
unittest.main(defaultTest='test_suite')
-
Modified: bloodhound/trunk/bloodhound_multiproduct/tests/mimeview/patch.py
URL: http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/tests/mimeview/patch.py?rev=1566948&r1=1566947&r2=1566948&view=diff
==============================================================================
--- bloodhound/trunk/bloodhound_multiproduct/tests/mimeview/patch.py (original)
+++ bloodhound/trunk/bloodhound_multiproduct/tests/mimeview/patch.py Tue Feb 11 01:52:30 2014
@@ -64,4 +64,3 @@ def test_suite():
if __name__ == '__main__':
unittest.main(defaultTest='test_suite')
-
Modified: bloodhound/trunk/bloodhound_multiproduct/tests/mimeview/pygments.py
URL: http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/tests/mimeview/pygments.py?rev=1566948&r1=1566947&r2=1566948&view=diff
==============================================================================
--- bloodhound/trunk/bloodhound_multiproduct/tests/mimeview/pygments.py (original)
+++ bloodhound/trunk/bloodhound_multiproduct/tests/mimeview/pygments.py Tue Feb 11 01:52:30 2014
@@ -23,7 +23,7 @@ from tests import unittest
from tests.env import MultiproductTestCase
from trac.mimeview.api import Mimeview
from trac.mimeview.pygments import PygmentsRenderer
-from trac.mimeview.tests import pygments as test_pygments
+from trac.mimeview.tests import pygments as test_pygments
from trac.web.chrome import Chrome
from multiproduct.env import ProductEnvironment
@@ -68,7 +68,7 @@ class ProductPygmentsRendererTestCase(su
self.global_env = self._env = None
ProductPygmentsRendererTestCase = unittest.skipUnless(
- test_pygments.have_pygments,
+ test_pygments.have_pygments,
'mimeview/tests/pygments (no pygments installed)'
)(ProductPygmentsRendererTestCase)
@@ -79,4 +79,3 @@ def test_suite():
if __name__ == '__main__':
unittest.main(defaultTest='test_suite')
-
Modified: bloodhound/trunk/bloodhound_multiproduct/tests/model.py
URL: http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/tests/model.py?rev=1566948&r1=1566947&r2=1566948&view=diff
==============================================================================
--- bloodhound/trunk/bloodhound_multiproduct/tests/model.py (original)
+++ bloodhound/trunk/bloodhound_multiproduct/tests/model.py Tue Feb 11 01:52:30 2014
@@ -41,14 +41,14 @@ class ProductTestCase(unittest.TestCase)
def setUp(self):
self.env = EnvironmentStub(enable=['trac.*', 'multiproduct.*'])
self.env.path = tempfile.mkdtemp(prefix='bh-product-tempenv-')
-
+
self.mpsystem = MultiProductSystem(self.env)
try:
self.mpsystem.upgrade_environment(self.env.db_transaction)
except self.env.db_exc.OperationalError:
# table remains but database version is deleted
pass
-
+
self.listener = self._enable_resource_change_listener()
self.default_data = {'prefix':self.INITIAL_PREFIX,
'name':self.INITIAL_NAME,
@@ -62,7 +62,7 @@ class ProductTestCase(unittest.TestCase)
def tearDown(self):
shutil.rmtree(self.env.path)
self.env.reset_db()
-
+
def _enable_resource_change_listener(self):
listener = TestResourceChangeListener(self.env)
listener.resource_type = Product
@@ -81,36 +81,36 @@ class ProductTestCase(unittest.TestCase)
test = {'prefix': 'td',
'name': 'test field access',
'description': 'product to test field setting'}
-
+
product = Product(self.env)
-
+
# attempt to set the fields from the data
product.prefix = test['prefix']
product.name = test['name']
product.description = test['description']
-
+
self.assertEqual(product._data['prefix'], test['prefix'])
self.assertEqual(product._data['name'], test['name'])
self.assertEqual(product._data['description'], test['description'])
-
+
def test_select(self):
"""tests that select can search Products by fields"""
-
+
p2_data = {'prefix':'tp2',
'name':'test project 2',
'description':'a different test project'}
p3_data = {'prefix':'tp3',
'name':'test project 3',
'description':'test project'}
-
+
product2 = Product(self.env)
product2._data.update(p2_data)
product3 = Product(self.env)
product3._data.update(p3_data)
-
+
product2.insert()
product3.insert()
-
+
products = list(Product.select(self.env, where={'prefix':'tp'}))
self.assertEqual(1, len(products))
products = list(Product.select(self.env,
@@ -119,43 +119,43 @@ class ProductTestCase(unittest.TestCase)
products = list(Product.select(self.env,
where={'prefix':'tp3', 'name':'test project 3'}))
self.assertEqual(1, len(products))
-
+
def test_update(self):
"""tests that we can use update to push data to the database"""
product = list(Product.select(self.env, where={'prefix':'tp'}))[0]
self.assertEqual('test project', product._data['name'])
-
- new_data = {'prefix':'tp',
- 'name':'updated',
+
+ new_data = {'prefix':'tp',
+ 'name':'updated',
'description':'nothing'}
product._data.update(new_data)
product.update()
-
+
comp_product = list(Product.select(self.env, where={'prefix':'tp'}))[0]
self.assertEqual('updated', comp_product._data['name'])
-
+
def test_update_key_change(self):
"""tests that we raise an error for attempting to update key fields"""
- bad_data = {'prefix':'tp0',
- 'name':'update',
+ bad_data = {'prefix':'tp0',
+ 'name':'update',
'description':'nothing'}
product = list(Product.select(self.env, where={'prefix':'tp'}))[0]
product._data.update(bad_data)
self.assertRaises(TracError, product.update)
-
+
def test_insert(self):
"""test saving new Product"""
data = {'prefix':'new', 'name':'new', 'description':'new'}
product = Product(self.env)
product._data.update(data)
product.insert()
-
+
check_products = list(Product.select(self.env, where={'prefix':'new'}))
-
+
self.assertEqual(product._data['prefix'],
check_products[0]._data['prefix'])
self.assertEqual(1, len(check_products))
-
+
def test_insert_duplicate_key(self):
"""test attempted saving of Product with existing key fails"""
dupe_key_data = {'prefix':'tp',
@@ -164,22 +164,22 @@ class ProductTestCase(unittest.TestCase)
product2 = Product(self.env)
product2._data.update(dupe_key_data)
self.assertRaises(TracError, product2.insert)
-
+
def test_delete(self):
"""test that we are able to delete Products"""
product = list(Product.select(self.env, where={'prefix':'tp'}))[0]
product.delete()
-
+
post = list(Product.select(self.env, where={'prefix':'tp'}))
self.assertEqual(0, len(post))
-
+
def test_delete_twice(self):
"""test that we error when deleting twice on the same key"""
product = list(Product.select(self.env, where={'prefix':'tp'}))[0]
product.delete()
-
+
self.assertRaises(TracError, product.delete)
-
+
def test_field_data_get(self):
"""tests that we can use table.field syntax to get to the field data"""
prefix = self.default_data['prefix']
@@ -189,12 +189,12 @@ class ProductTestCase(unittest.TestCase)
self.assertEqual(prefix, product.prefix)
self.assertEqual(name, product.name)
self.assertEqual(description, product.description)
-
+
def test_field_set(self):
"""tests that we can use table.field = something to set field data"""
prefix = self.default_data['prefix']
product = list(Product.select(self.env, where={'prefix':prefix}))[0]
-
+
new_description = 'test change of description'
product.description = new_description
self.assertEqual(new_description, product.description)
@@ -218,7 +218,7 @@ class ProductTestCase(unittest.TestCase)
for table in schema:
for statement in db_connector.to_sql(table):
db(statement)
-
+
structure = dict([(table.name, [col.name for col in table.columns])
for table in schema])
tm1 = TestModel(self.env)
@@ -284,4 +284,3 @@ def suite():
if __name__ == '__main__':
unittest.main()
-
Modified: bloodhound/trunk/bloodhound_multiproduct/tests/perm.py
URL: http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/tests/perm.py?rev=1566948&r1=1566947&r2=1566948&view=diff
==============================================================================
--- bloodhound/trunk/bloodhound_multiproduct/tests/perm.py (original)
+++ bloodhound/trunk/bloodhound_multiproduct/tests/perm.py Tue Feb 11 01:52:30 2014
@@ -40,7 +40,7 @@ from tests.env import MultiproductTestCa
perm.DefaultPermissionPolicy.CACHE_EXPIRY = 0
-class ProductDefaultPermissionStoreTestCase(DefaultPermissionStoreTestCase,
+class ProductDefaultPermissionStoreTestCase(DefaultPermissionStoreTestCase,
MultiproductTestCase):
def setUp(self):
@@ -64,17 +64,17 @@ class ProductDefaultPermissionStoreTestC
store1 = perm.DefaultPermissionStore(env1)
global_env.db_transaction.executemany(
- "INSERT INTO permission VALUES (%s,%s)",
+ "INSERT INTO permission VALUES (%s,%s)",
[('dev', 'WIKI_MODIFY'),
('dev', 'REPORT_ADMIN'),
('john', 'dev')])
env.db_transaction.executemany(
- "INSERT INTO permission VALUES (%s,%s)",
+ "INSERT INTO permission VALUES (%s,%s)",
[('dev', 'WIKI_VIEW'),
('dev', 'REPORT_VIEW'),
('john', 'dev')])
env1.db_transaction.executemany(
- "INSERT INTO permission VALUES (%s,%s)",
+ "INSERT INTO permission VALUES (%s,%s)",
[('dev', 'TICKET_CREATE'),
('dev', 'MILESTONE_VIEW'),
('john', 'dev')])
@@ -185,7 +185,7 @@ class SudoTestCase(ProductPermissionCach
with self.assertRaises(RuntimeError) as test_cm:
sudoperm.has_permission('TEST_MODIFY')
- self.assertEqual('Permission check out of context',
+ self.assertEqual('Permission check out of context',
str(test_cm.exception))
with self.assertRaises(ValueError) as test_cm:
@@ -210,30 +210,30 @@ class SudoTestCase(ProductPermissionCach
sudoperm = sudo(None, 'TEST_CREATE', ['TRAC_ADMIN'])
sudoperm.perm = self.perm
-
+
self.assertTrue(sudoperm.has_permission('EMAIL_VIEW'))
def test_sudo_ambiguous(self):
with self.assertRaises(ValueError) as test_cm:
- sudo(None, 'TEST_MODIFY', ['TEST_MODIFY', 'TEST_DELETE'],
+ sudo(None, 'TEST_MODIFY', ['TEST_MODIFY', 'TEST_DELETE'],
['TEST_MODIFY', 'TEST_CREATE'])
- self.assertEquals('Impossible to grant and revoke (TEST_MODIFY)',
+ self.assertEquals('Impossible to grant and revoke (TEST_MODIFY)',
str(test_cm.exception))
with self.assertRaises(ValueError) as test_cm:
- sudoperm = sudo(None, 'TEST_MODIFY', ['TEST_ADMIN'],
+ sudoperm = sudo(None, 'TEST_MODIFY', ['TEST_ADMIN'],
['TEST_MODIFY', 'TEST_CREATE'])
sudoperm.perm = self.perm
self.assertEquals('Impossible to grant and revoke '
- '(TEST_CREATE, TEST_MODIFY)',
+ '(TEST_CREATE, TEST_MODIFY)',
str(test_cm.exception))
with self.assertRaises(ValueError) as test_cm:
req = Mock(perm=self.perm)
- sudo(req, 'TEST_MODIFY', ['TEST_ADMIN'],
+ sudo(req, 'TEST_MODIFY', ['TEST_ADMIN'],
['TEST_MODIFY', 'TEST_CREATE'])
self.assertEquals('Impossible to grant and revoke '
- '(TEST_CREATE, TEST_MODIFY)',
+ '(TEST_CREATE, TEST_MODIFY)',
str(test_cm.exception))
# Sudo permission context equivalent to permissions cache
@@ -254,9 +254,9 @@ class SudoTestCase(ProductPermissionCach
for tcnm in tcnames:
f1 = _test_with_sudo_rules(tcnm, '', [])
- f2 = _test_with_sudo_rules(tcnm, 'test_sudo_partial_',
+ f2 = _test_with_sudo_rules(tcnm, 'test_sudo_partial_',
['TEST_MODIFY'])
- f3 = _test_with_sudo_rules(tcnm, 'test_sudo_full_',
+ f3 = _test_with_sudo_rules(tcnm, 'test_sudo_full_',
['TEST_MODIFY', 'TEST_ADMIN'])
for f in (f1, f2, f3):
_gen_tests[f.func_name] = f
@@ -267,7 +267,7 @@ list(setattr(SudoTestCase, tcnm, f)
for tcnm, f in SudoTestCase._gen_tests.iteritems())
-class ProductPermissionPolicyTestCase(PermissionPolicyTestCase,
+class ProductPermissionPolicyTestCase(PermissionPolicyTestCase,
MultiproductTestCase):
@property
def env(self):
@@ -294,7 +294,7 @@ class ProductPermissionPolicyTestCase(Pe
def setUp(self):
super(ProductPermissionPolicyTestCase, self).setUp()
- self.global_env.config.set('trac', 'permission_policies',
+ self.global_env.config.set('trac', 'permission_policies',
'DefaultPermissionPolicy')
self.permsys = perm.PermissionSystem(self.env)
self.global_perm_admin = perm.PermissionAdmin(self.global_env)
@@ -309,7 +309,7 @@ class ProductPermissionPolicyTestCase(Pe
self.permsys.policies)
def test_policy_chaining(self):
- self.env.config.set('trac', 'permission_policies',
+ self.env.config.set('trac', 'permission_policies',
'TestPermissionPolicy,DefaultPermissionPolicy')
self.policy.grant('testuser', ['TEST_MODIFY'])
system = perm.PermissionSystem(self.env)
@@ -346,7 +346,7 @@ class ProductPermissionPolicyTestCase(Pe
'Check for permission action %s' % (action,))
self.assertFalse(self.perm.has_permission('UNKNOWN_PERM'))
- # Clear permissions cache and retry
+ # Clear permissions cache and retry
self.perm._cache.clear()
self.global_perm_admin._do_remove('testuser', 'TRAC_ADMIN')
@@ -371,9 +371,9 @@ class ProductPermissionPolicyTestCase(Pe
# Setting TRAC_ADMIN permission in product scope is in vain
# since it controls access to critical actions affecting the whole site
# This will protect the system against malicious actors
- # and / or failures leading to the addition of TRAC_ADMIN permission
+ # and / or failures leading to the addition of TRAC_ADMIN permission
# in product perm store in spite of obtaining unrighteous super powers.
- # On the other hand this also means that PRODUCT_ADMIN(s) are
+ # On the other hand this also means that PRODUCT_ADMIN(s) are
# able to set user permissions at will without jeopardizing system
# integrity and stability.
self.product_perm_admin._do_add('testuser', 'TRAC_ADMIN')
@@ -439,7 +439,7 @@ class ProductPermissionPolicyTestCase(Pe
def test_suite():
suite = unittest.TestSuite()
- suite.addTest(unittest.makeSuite(ProductDefaultPermissionStoreTestCase,
+ suite.addTest(unittest.makeSuite(ProductDefaultPermissionStoreTestCase,
'test'))
suite.addTest(unittest.makeSuite(ProductPermissionSystemTestCase, 'test'))
suite.addTest(unittest.makeSuite(ProductPermissionCacheTestCase, 'test'))
@@ -452,4 +452,3 @@ def test_suite():
if __name__ == '__main__':
unittest.main(defaultTest='test_suite')
-