Package trac :: Package versioncontrol :: Package web_ui :: Package tests :: Module wikisyntax

Module wikisyntax

source code

Classes
  GitRepositoryStub
Functions
 
repository_setup(tc) source code
 
test_suite() source code
 
datetime_now(...)
[tz] -> new datetime with tz's local day and time.
source code
Markup
escape(text, quotes=True)
Create a Markup instance from a string and escape special characters it may contain (<, >, & and ").
source code
Variables
  YOUNGEST_REV = 200
  CHANGESET_TEST_CASES = ...
  LOG_TEST_CASES = ...
  DIFF_TEST_CASES = ...
  SOURCE_TEST_CASES = ...
  CHUNK_SIZE = 4096
  CRLF = '\r\n'
  __package__ = 'trac.versioncontrol.web_ui.tests'
  tag = <genshi.builder.ElementFactory object at 0x7f4932e45810>
  utc = <FixedOffset "UTC" 0:00:00>

Imports: unittest, Mock, formatter, ABCMeta, AdminCommandError, AnyDiffModule, BlameAnnotator, BoolOption, BrowserModule, Changeset, ChangesetModule, Chrome, Component, ConfigSection, DbRepositoryProvider, DefaultPropertyDiffRenderer, DefaultPropertyRenderer, EmptyChangeset, ExtensionPoint, IAdminCommandProvider, IHTMLPreviewAnnotator, INavigationContributor, IPermissionRequestor, IPropertyDiffRenderer, IPropertyRenderer, IRepositoryChangeListener, IRepositoryConnector, IRepositoryProvider, IRequestFilter, IRequestHandler, IResourceManager, ISearchSource, ITemplateProvider, ITimelineEventProvider, IWikiMacroProvider, IWikiSyntaxProvider, IntOption, Interface, InvalidConnector, InvalidRepository, ListOption, LogModule, Markup, Mimeview, NoSuchChangeset, NoSuchNode, Node, Option, PermissionError, Ranges, RenderedProperty, Repository, RepositoryManager, RequestDone, Resource, ResourceNotFound, RevRanges, TimeRange, TracBaseError, TracError, TracValueError, WikiParser, WikiPropertyRenderer, abstractmethod, add_ctxtnav, add_link, add_script, add_script_data, add_stylesheet, as_bool, auth_link, browser, changeset, cleandoc_, content_closing, content_disposition, datetime, diff_blocks, embedded_numbers, exception_to_unicode, fnmatchcase, format_to, format_to_html, format_to_oneliner, from_utimestamp, get_allowed_node, get_changes, get_diff_options, get_dir_list, get_existing_node, get_path_links, groupby, http_date, implements, is_binary, is_default, log, make_log_graph, ngettext, os, parse_args, partial, pathjoin, posixpath, pretty_timedelta, prevnext_nav, printout, re, render_zip, search_to_sql, shorten_line, shorten_result, tag_, threading, time_now, timedelta, to_datetime, to_json, to_unicode, unicode_urlencode, unified_diff, util, web_context, wrap


Function Details

escape(text, quotes=True)

source code 

Create a Markup instance from a string and escape special characters it may contain (<, >, & and ").

>>> escape('"1 < 2"')
<Markup u'&#34;1 &lt; 2&#34;'>

If the quotes parameter is set to False, the " character is left as is. Escaping quotes is generally only required for strings that are to be used in attribute values.

>>> escape('"1 < 2"', quotes=False)
<Markup u'"1 &lt; 2"'>
Parameters:
  • text - the text to escape
  • quotes - if True, double quote characters are escaped in addition to the other special characters
Returns: Markup
the escaped Markup string

Variables Details

CHANGESET_TEST_CASES

Value:
u'''
============================== changeset: link resolver
changeset:1
changeset:12
changeset:abc
changeset:1, changeset:1/README.txt
------------------------------
<p>
...

LOG_TEST_CASES

Value:
u'''
============================== Log range TracLinks
[1:2], r1:2, [12:23], r12:23
[1:2/trunk], r1:2/trunk
[2:1/trunk] reversed, r2:1/trunk reversed
------------------------------
<p>
<a class="source" href="/log/?revs=1-2">[1:2]</a>, <a class="source" h\
...

DIFF_TEST_CASES

Value:
u'''
============================== diff: link resolver
diff:trunk//branch
diff:trunk@12//branch@23
diff:trunk@12:23
diff:@12:23
------------------------------
<p>
...

SOURCE_TEST_CASES

Value:
u'''
============================== source: link resolver
source:/foo/bar
source:/foo/bar#42   # no long works as rev spec
source:/foo/bar#head #
source:/foo/bar@42
source:/foo/bar@head
source:/foo%20bar/baz%2Bquux
...