~ubuntu-branches/ubuntu/trusty/python-docutils/trusty-proposed

« back to all changes in this revision

Viewing changes to test/test_parsers/test_rst/test_directives/test_tables.py

  • Committer: Package Import Robot
  • Author(s): Michael Schutte, Jakub Wilk, Michael Schutte, Dmitry Shachnev
  • Date: 2013-08-05 16:47:43 UTC
  • mfrom: (11.1.9 experimental)
  • Revision ID: package-import@ubuntu.com-20130805164743-00lyz2imgs85ttwz
Tags: 0.11-1
[ Jakub Wilk ]
* Remove martin f. krafft and Ben Finney from Uploaders at their requests.

[ Michael Schutte ]
* New upstream release 0.11, closes: #712284, #714880.
  - Drop patch math-output-html.diff: Fixed upstream.
  - Drop patch fix-buildhtml-progress.diff: Applied upstream.
  - Drop patch strict-csv-parser.diff: Fixed upstream.
  - Drop patch unknown-url-exc-use-repr.diff: Applied upstream.
  - Update patch move-data-to-usr-share.diff: Default stylesheet paths for
    writers/html4css1 have changed.
  - Refresh the remaining patches.
  - New patch no-local-roman.diff: Use the roman module from python-roman
    instead of the copy shipped with docutils.
  - Update information about upstream version control in debian/copyright.
* Change my e-mail host in Uploaders and debian/copyright to @debian.org.
* New patch rst2odt_prepstyles-elementtree.diff: Port the rst2odt_prepstyles
  utility to ElementTree.  Drop Recommends: python-lxml.  Closes: #714319.
* New patch odt-writer-ascii-filenames.diff: Only use ASCII for filenames of
  images embedded in ODT files, closes: #714317.

[ Dmitry Shachnev ]
* Use dh_python2 instead of deprecated dh_pysupport.
* Add XS-Testsuite header, and replace XS-Python-Version with preferred
  X-Python-Version (closes: #685509).
* Add myself to Uploaders.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! /usr/bin/env python
2
2
 
3
 
# $Id: test_tables.py 7463 2012-06-22 19:49:51Z milde $
 
3
# $Id: test_tables.py 7664 2013-05-17 08:16:41Z milde $
4
4
# Author: David Goodger <goodger@python.org>
5
5
# Copyright: This module has been placed in the public domain.
6
6
 
10
10
 
11
11
from __init__ import DocutilsTestSupport
12
12
 
13
 
import os
 
13
import os, sys
14
14
import csv
15
 
import sys
16
15
from docutils.parsers.rst.directives import tables
17
16
 
18
17
 
33
32
else:
34
33
    unichr_exception_string = str(unichr_exception)
35
34
 
 
35
# some error messages changed in Python 3.3:
 
36
csv_eod_error_str = 'unexpected end of data'
 
37
if sys.version_info < (3,2,4) and not (# backport to 2.7.4
 
38
    sys.version_info[:2] == (2,7) and sys.version_info[2] > 3):
 
39
    csv_eod_error_str = 'newline inside string'
36
40
csv_unknown_url = "'bogus.csv'"
37
41
if sys.version_info < (3,3,2):
38
42
    csv_unknown_url = "bogus.csv"
47
51
 
48
52
null_bytes_exception = DocutilsTestSupport.exception_data(null_bytes)[0]
49
53
 
50
 
def unexpected_eod():
51
 
    reader = csv.reader(['"\n'], strict=1)
52
 
    reader.next()
53
 
 
54
 
unexpected_eod_exception = DocutilsTestSupport.exception_data(unexpected_eod)[0]
55
 
 
56
54
totest = {}
57
55
 
58
56
totest['table'] = [
776
774
            .. csv-table:: bad CSV data
777
775
            \n\
778
776
               "bad", \"csv, data
779
 
""" % unexpected_eod_exception],
 
777
""" % csv_eod_error_str],
780
778
["""\
781
779
.. csv-table:: bad CSV header data
782
780
   :header: "bad", \"csv, data
794
792
               :header: "bad", \"csv, data
795
793
            \n\
796
794
               good, csv, data
797
 
""" % unexpected_eod_exception],
 
795
""" % csv_eod_error_str],
798
796
["""\
799
797
.. csv-table:: bad encoding
800
798
   :file: %s