summaryrefslogtreecommitdiff
path: root/sandbox/tibs/pysource/test
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/tibs/pysource/test')
-rw-r--r--sandbox/tibs/pysource/test/readme.txt27
-rw-r--r--sandbox/tibs/pysource/test/test.doctest12
-rwxr-xr-xsandbox/tibs/pysource/test/test.py124
-rw-r--r--sandbox/tibs/pysource/test/test.rtxt442
-rwxr-xr-xsandbox/tibs/pysource/test/testassign.py12
-rwxr-xr-xsandbox/tibs/pysource/test/testfunc.py34
-rwxr-xr-xsandbox/tibs/pysource/test/testinterpreted.py44
-rwxr-xr-xsandbox/tibs/pysource/test/testinterpreted2.py37
-rwxr-xr-xsandbox/tibs/pysource/test/testsimp.py12
-rwxr-xr-xsandbox/tibs/pysource/test/testyield.py8
10 files changed, 0 insertions, 752 deletions
diff --git a/sandbox/tibs/pysource/test/readme.txt b/sandbox/tibs/pysource/test/readme.txt
deleted file mode 100644
index a6af4576d..000000000
--- a/sandbox/tibs/pysource/test/readme.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-Files in the ``test`` directory
--------------------------------
-
-This directory is intended to contain various test file. They are (hopefully)
-named in a consistent manner:
-
-README.txt
- This file.
-
-``*.rtxt``
- Sample reST text files, suitable for checking odd things.
-
-``*.py``
- Sample Python test files, ditto.
-
-``*.doctest``
- Files that contain "semiliterate testing" [1]_ -- that is,
- descriptive text (written with reST) surrounding doctest blocks.
- The idea is that these files should be passed to (for instance)
- pydps.py (or whatever it is called at the moment) to be tested by
- Tim Peters' doctest - for instance::
-
- pydps/pydps.py --text --doctest simple.doctest
-
-
-
-.. [1] a semi-lame reference to literate programming, I'm afraid.
diff --git a/sandbox/tibs/pysource/test/test.doctest b/sandbox/tibs/pysource/test/test.doctest
deleted file mode 100644
index bc91115ad..000000000
--- a/sandbox/tibs/pysource/test/test.doctest
+++ /dev/null
@@ -1,12 +0,0 @@
-The following is some Python code:
-
- >>> a = 1
- >>> a
- 1
-
-and here is some more:
-
- >>> a + 1
- 3
-
-and that's all.
diff --git a/sandbox/tibs/pysource/test/test.py b/sandbox/tibs/pysource/test/test.py
deleted file mode 100755
index b3e380526..000000000
--- a/sandbox/tibs/pysource/test/test.py
+++ /dev/null
@@ -1,124 +0,0 @@
-"""A simple test file for input to ast-mining.py.
-
-But it isn't a "raw" string, so:
-
- \\*escape* \\`with` "\\\\"
-"""
-
-__docformat__ = "reST"
-
-import string
-
-one = 1
-
-"""Documentation after `one` (intervening blank line)"""
-
-two,three = 2,3
-"""Documenatation after ``two,three=2,3``"""
-
-four,five = two,three
-
-six = [four,five]
-"""Documentation after ``six=[four,five]``"""
-
-global gmodule
-gmodule = 1
-"""Global at the module level"""
-
-def func(a,b=1,c='jim',d=None,e=[],f={'a':1},g=(1,2,3)):
- r"""Function at the module level
-
- This *is* a "raw" string, so:
-
- \*escape* \`with` "\\"
- """
-
- from string import lstrip,rstrip
-
- a = 3
-
- global gfunc
- gfunc = 1
- """Global referenced only within `func()`"""
-
- global one
- one = 2
-
- class InFunc:
- pass
-
- def infunc():
- """Function defined inside function `func()`"""
- global ginner
- ginner = 1
- """Global referenced only within `infunc()`"""
-
- class Silly:
- pass
-
- def silly_fn():
- pass
-
-def func2(a,*args,**kargs):
- pass
-
-def func3((a,b,c),d):
- pass
-
-class Fred:
- """Class at the module level."""
-
- a = 1
- """Documentation for class value `a`"""
-
- global gclass
- gclass = 2
- """Global referenced only within `Fred`"""
-
- def __init__(self):
- """Initialisation for `Fred`"""
- self.b = 2
- """`self.b` within `Fred.__init__()`"""
-
- c = 3
- """Local variable within `Fred.__init__()`"""
-
- global gmeth
- gmeth = 3
- """Global referenced only within a method"""
-
- global gagain
- gagain = 3
-
- class Insider:
- """Class defined inside `Fred.__init__()`"""
-
- a = 'jim'
- """Local name within class inside `Fred.__init__()`"""
-
- global gclass2
- gclass2 = 4
- """Global referenced only within a class within a method"""
-
- global gunused
- global gagain
-
- def fred(self):
- global gunused2,gfunc2
- gfunc2 = 5
- """Global referenced only within a method in a
- class in a method
- """
-
- def fredinner():
- global ginner2
- global gagain
- ginner2 = 6
- gagain = 6
-
- infredinner = 7
-
-class Jim(Fred):
- pass
-
-
diff --git a/sandbox/tibs/pysource/test/test.rtxt b/sandbox/tibs/pysource/test/test.rtxt
deleted file mode 100644
index f28a3d4e2..000000000
--- a/sandbox/tibs/pysource/test/test.rtxt
+++ /dev/null
@@ -1,442 +0,0 @@
-pydps test document
-===================
-
-:Author: Tibs
-:Version: 0.1
-:Eggs: Green
-:Ham: Green
-
-This is intended to be a simple test document, with "something of everything".
-It is *not* intended to trawl for *problems*, but just to check I've got the
-writing out of just about everything supported in the HTML writer.
-
- :Author: Tibs
- :Version: 0.1
- :Eggs: Green
- :Ham: Green
- :Parameter i: integer
-
-Lists
------
-1. A list
-2. Some more
-3.
-
- * What's this?
- - and this?
- + and this?
-
-i. And this is Roman
-
-a. And this is alpha
-
-A. And so is this
-
-I. What is this?
-
-.. Just a comment, honest.
- That's all.
-
-A title
- and some text.
-And another
- and more text.
-
-Short options:
-
--a option a
-
--b file option b
-
--cname option c
-
-Long options:
-
---aaaa option aaaa
---bbbb=file option bbbb
---cccc name option cccc
---d-e-f-g option d-e-f-g
---h_i_j_k option h_i_j_k
-
-VMS/DOS-style options:
-
-/A option A
-/B file option B
-/Cstring option C
-
-Mixed short, long, and VMS/DOS options:
-
--a option a
---bbbb=file option bbbb
-/C option C
---dddd name option dddd
--e string option e
-/F file option F
-
-Aliased options:
-
--a, --aaaa, /A option a, aaaa, A
--b file, --bbbb=file, /B file option b, bbbb, B
-
-Multiple lines in descriptions, aligned:
-
--a option a, line 1
- line 2
--b file option b, line 1
- line 2
-
-Multiple lines in descriptions, not aligned:
-
--a option a, line 1
- line 2
--b file option b, line 1
- line 2
-
-Some edge cases:
-
---option=arg arg too many arguments
-
---option=arg=arg too many arguments
-
--aletter arg too many arguments (-a letter)
-
-/Aletter arg too many arguments (/A letter)
-
--a=b can't use = for short arguments
-
-/A=b can't use = for DOS/VMS arguments?
-
---option= argument missing
-
---=argument option missing
-
--- everything missing
-
-- this should be a bullet list item
-
-+ bullet
-
-.. Comments swallow up all indented text following.
-
- (Therefore this is not a) block quote.
-
-- bullet
-
- If we want a block quote after this bullet list item,
- we need to use an empty comment:
-
-..
-
- Block quote.
-
-Other blocks
-------------
-
-::
-
- Anonymous literal block
-
-This is a literal block::
-
- This here.
-
-And we don't need colons ::
-
- Not really.
-
-Of course, **I** like Python:
-
- >>> print " Indented block & output."
- Indented block & output.
-
-Or maybe I don't::
-
- >>> print " Indented block & output."
- Indented block & output.
-
-Footnotes
----------
-
-Autonumbered footnotes
-......................
-[#]_ is the first auto-numbered footnote reference.
-[#]_ is the second auto-numbered footnote reference.
-
-.. [#] Auto-numbered footnote 1.
-.. [#] Auto-numbered footnote 2.
-.. [#] Auto-numbered footnote 3.
-
-[#]_ is the third auto-numbered footnote reference.
-
-Autonumbered and named footnotes
-................................
-[#six]_ is a reference to the sixth auto-numbered footnote.
-
-.. [#four] Fourth auto-numbered footnote.
-.. [#five] Fifth auto-numbered footnote.
-.. [#six] Sixth auto-numbered footnote.
-
-[#five]_ is a reference to the fifth auto-numbered footnote.
-[#four]_ is a reference to the fourth auto-numbered footnote.
-[#six]_ is another reference to the sixth auto-numbered footnote.
-
-Here are some internal cross-references to the implicit targets
-generated by the footnotes: four_, five_, six_.
-
-Mixed anonymous and labelled auto-numbered footnotes
-....................................................
-[#ten]_ should be 10, [#]_ should be 7,
-[#]_ should be 9, [#]_ is one too many,
-[#eight]_ should be 8, and [#twelve]_ doesn't exist,
-nor does [#eleven]_.
-
-.. [#] Auto-numbered footnote 7.
-.. [#eight] Auto-numbered footnote 8.
-.. [#] Auto-numbered footnote 9.
-.. [#ten] Auto-numbered footnote 10.
-.. [#eleven] Auto-numbered footnote 11.
-.. [#eleven] Auto-numbered footnote 11 again (duplicate).
-
-Inline stuff
-------------
-(**strong**) but not (**) or '(** ' or x**2 or \\**kwargs or **
-
-(however, '**kwargs' will trigger a warning and may be problematic)
-
-Strong asterisk: *****
-
-Strong double asterisk: ******
-
-``literal``
-``lite\\ral``
-
-``literal ``TeX quotes'' & \\backslash`` but not "``" or ``
-
-(however, ``standalone TeX quotes'' will trigger a warning
-and may be problematic)
-
-Find the ```interpreted text``` in this paragraph!
-
-`interpreted`
-:role:`interpreted`
-
-`interpreted` but not \\`interpreted` [`] or ({[`] or [`]}) or `
-
-`interpreted`-text `interpreted`: text `interpreted`:text `text`'s interpreted
-
-http://www.standalone.hyperlink.com
-
-one-slash-only:/absolute.path
-
-mailto:someone@somewhere.com
-
-news:comp.lang.python
-
-An email address in a sentence: someone@somewhere.com.
-
-ftp://ends.with.a.period.
-
-(a.question.mark@end?)
-
-Tables
-------
-
-+-------------------------------------+
-| A table with one cell and one line. |
-+-------------------------------------+
-
-+-----------------------+
-| A malformed table. |
-+-----------------------+
-
-+------------------------+
-| A well-formed | table. |
-+------------------------+
-
-+------------------------+
-| This +----------+ too! |
-+------------------------+
-
-+--------------------------+
-| A table with three rows, |
-+------------+-------------+
-| and two | columns. |
-+------------+-------------+
-| First and last rows |
-| contain column spans. |
-+--------------------------+
-
-+------------+-------------+---------------+
-| A table | two rows in | and row spans |
-| with three +-------------+ to left and |
-| columns, | the middle, | right. |
-+------------+-------------+---------------+
-
-+------------+-------------+---------------+
-| A table | | two rows in | and funny |
-| with 3 +--+-------------+-+ stuff. |
-| columns, | the middle, | | |
-+------------+-------------+---------------+
-
-+-----------+-------------------------+
-| W/NW cell | N/NE cell |
-| +-------------+-----------+
-| | Middle cell | E/SE cell |
-+-----------+-------------+ |
-| S/SE cell | |
-+-------------------------+-----------+
-
-+--------------+-------------+
-| A bad table. | |
-+--------------+ |
-| Cells must be rectangles. |
-+----------------------------+
-
-+-------------------------------+
-| A table with two header rows, |
-+------------+------------------+
-| the first | with a span. |
-+============+==================+
-| Two body | rows, |
-+------------+------------------+
-| the second with a span. |
-+-------------------------------+
-
-+-------------------------------+
-| A table with two head/body |
-+=============+=================+
-| row | separators. |
-+=============+=================+
-| That's bad. | |
-+-------------+-----------------+
-
-The traditional:
-
- +------------------------+------------+----------+----------+
- | Header row, column 1 | Header 2 | Header 3 | Header 4 |
- +========================+============+==========+==========+
- | body row 1, column 1 | column 2 | column 3 | column 4 |
- +------------------------+------------+----------+----------+
- | body row 2 | Cells may span columns. |
- +------------------------+------------+---------------------+
- | body row 3 | Cells may | - Table cells |
- +------------------------+ span rows. | - contain |
- | body row 4 | | - body elements. |
- +------------------------+------------+---------------------+
-
-+-----------------+--------+
-| A simple table | cell 2 |
-+-----------------+--------+
-| cell 3 | cell 4 |
-+-----------------+--------+
-No blank line after table.
-
-+-----------------+--------+
-| A simple table | cell 2 |
-+-----------------+--------+
-| cell 3 | cell 4 |
-+-----------------+--------+
- Unexpected indent and no blank line after table.
-
-+------------------------------+
-| This table contains another. |
-| |
-| +-------------------------+ |
-| | A table within a table. | |
-| +-------------------------+ |
-+------------------------------+
-
-+------------------+--------+
-| A simple table | |
-+------------------+--------+
-| with empty cells | |
-+------------------+--------+
-
-Links and so on
----------------
-.. _target:
-
-(internal hyperlink)
-
-.. _one-liner: http://structuredtext.sourceforge.net
-
-.. _starts-on-this-line: http://
- structuredtext.
- sourceforge.net
-
-.. _entirely-below:
- http://structuredtext.
- sourceforge.net
-
-.. _target1: Not a proper hyperlink target
-
-.. _a long target name:
-
-.. _`a target name: including a colon (quoted)`:
-
-.. _a target name\: including a colon (escaped):
-
-.. _target2: http://www.python.org/
-
-(indirect external hyperlink)
-
-Duplicate indirect links (different URIs):
-
-.. _target3: first
-
-.. _target3: second
-
-Duplicate indirect links (same URIs):
-
-.. _target4: first
-
-.. _target4: first
-
-Directives
-----------
-.. Attention:: Directives at large.
-
-.. Note:: This is a note.
-
-.. Tip:: 15% if the
- service is good.
-
-- .. WARNING:: Strong prose may provoke extreme mental exertion.
- Reader discretion is strongly advised.
-- .. Error:: Does not compute.
-
-.. Caution::
-
- Don't take any wooden nickels.
-
-.. DANGER:: Mad scientist at work!
-
-.. Important::
- - Wash behind your ears.
- - Clean up your room.
- - Call your mother.
- - Back up your data.
-
-.. image:: images/ball.gif
-
-.. image::
- picture.png
- [height=100 width=200 scale=50]
-
-.. figure:: picture.png
-
- A picture with a caption.
-
-.. figure:: picture.png
-
- A picture with a caption and a legend.
-
- +-----------------------+-----------------------+
- | Symbol | Meaning |
- +=======================+=======================+
- | .. image:: tent.png | Campground |
- +-----------------------+-----------------------+
- | .. image:: waves.png | Lake |
- +-----------------------+-----------------------+
- | .. image:: peak.png | Mountain |
- +-----------------------+-----------------------+
diff --git a/sandbox/tibs/pysource/test/testassign.py b/sandbox/tibs/pysource/test/testassign.py
deleted file mode 100755
index e4d70a356..000000000
--- a/sandbox/tibs/pysource/test/testassign.py
+++ /dev/null
@@ -1,12 +0,0 @@
-class Jim:
-
- def __init__(self):
- a = 1
- a = [2,3]
- a,b = 4,5
- a,b = [6,7]
- a,self.a = 8,9
- a = b = self.a = 10
- a,b = c,d = 11,12
- self.a,self.b = 13,14
- self.a = self.b = 15
diff --git a/sandbox/tibs/pysource/test/testfunc.py b/sandbox/tibs/pysource/test/testfunc.py
deleted file mode 100755
index 4a887b098..000000000
--- a/sandbox/tibs/pysource/test/testfunc.py
+++ /dev/null
@@ -1,34 +0,0 @@
-# Stuff needed to make the examples compile...
-class Fred:
- def __getitem__(self,index):
- pass
-a = Fred()
-b = [1,2,3,4]
-d = Fred()
-
-def func1(a,b=1,c='jim',d=None,e=[],f={'a':1,a:1},g=(1,2,3)):
- pass
-
-def func2(a,*args,**kargs):
- pass
-
-def func2a(a,*args):
- pass
-
-def func2b(a,**kargs):
- pass
-
-def func3((a,b,c),d):
- pass
-
-def func4(a=a,b=Fred,c=Fred()):
- pass
-
-def func5(a=[x for x in [1,2,3] if x > 2],
- b=[(x,y) for x in [1,2,3] for y in [3,4,5]]):
- pass
-
-def func6(a=b[1:2],c=d[1,4:6,...,8:9:10],
- e=lambda x: x*2,
- f=lambda x,a=a: func5(x,a)):
- pass
diff --git a/sandbox/tibs/pysource/test/testinterpreted.py b/sandbox/tibs/pysource/test/testinterpreted.py
deleted file mode 100755
index 00eb59311..000000000
--- a/sandbox/tibs/pysource/test/testinterpreted.py
+++ /dev/null
@@ -1,44 +0,0 @@
-"""Test interpreted text
-
-This module (`testinterpreted`) contains one :class:`Fred`
-(and one hopes `Fred` will also work) and a function *and*
-a method called `fred`.
-
-NB: the above sentence *should*, when transformed into HTML
-or some other output format, hopefully, contain text something
-like::
-
- contains one class Fred
-
-i.e., the ``:class:`Fred``` should probably cause the "insertion"
-of the word "class". Or so I think.
-""" #'
-
-__docformat__ = "reST"
-
-class Fred:
- """This class (`Fred`), in :module:`testinterpreted`, contains
- a method `fred`.
- """
-
- jim = None
- """A class value, a default.
- """
-
- def fred(self):
- """This method (`fred`) is in class `Fred`
- """
- fred = 3
- """This name (`fred`) is in :function:`fred` in class `Fred`.
- """
-
-def fred(fred):
- """This function (:function:`fred`) is *not* in class `Fred`.
-
- It has one argument, :parameter:`fred`.
-
- If I just say `fred`, what *should* that resolve to?
- """
- fred.jim = 3
- """We assume that `fred` must be something with a `jim` attribute...
- """
diff --git a/sandbox/tibs/pysource/test/testinterpreted2.py b/sandbox/tibs/pysource/test/testinterpreted2.py
deleted file mode 100755
index 59dac777a..000000000
--- a/sandbox/tibs/pysource/test/testinterpreted2.py
+++ /dev/null
@@ -1,37 +0,0 @@
-"""
-This is the example from David Goodger's DPS document pysource-reader.txt.
-"""
-
-__docformat__ = "restructuredtext"
-
-class Keeper(Storer):
-
- """
- Extend `Storer`. Class attribute `instances` keeps track of
- the number of `Keeper` objects instantiated.
- """
-
- instances = 0
- """How many `Keeper` objects are there?"""
-
- def __init__(self):
- """
- Extend `Storer.__init__()` to keep track of instances.
-
- Keep count in `self.instances` and data in `self.data`.
- """
- Storer.__init__(self)
- self.instances += 1
-
- self.data = []
- """Store data in a list, most recent last."""
-
- def storedata(self, data):
- """
- Extend `Storer.storedata()`; append new `data` to a list
- (in `self.data`).
-
- Use :method:`Keeper.storedata` to store the object's data in
- `Keeper.data`:instance_attribute:.
- """
- self.data = data
diff --git a/sandbox/tibs/pysource/test/testsimp.py b/sandbox/tibs/pysource/test/testsimp.py
deleted file mode 100755
index 7dfeb4202..000000000
--- a/sandbox/tibs/pysource/test/testsimp.py
+++ /dev/null
@@ -1,12 +0,0 @@
-a = 'b'
-class Fred:
- """A *silly* demonstration."""
-
- def __init__(self, b=1, c='jim', d=None, f={'a':1,a:1},
- g=[x for x in [1,2,3] if x > 2]):
- """Initialise ourselves."""
- self.list = g
-
- def __call__(self,a):
- """Call ourselves."""
- pass
diff --git a/sandbox/tibs/pysource/test/testyield.py b/sandbox/tibs/pysource/test/testyield.py
deleted file mode 100755
index e3fd1d2d0..000000000
--- a/sandbox/tibs/pysource/test/testyield.py
+++ /dev/null
@@ -1,8 +0,0 @@
-from __future__ import generators
-from string import lower as lll
-from string import lower as lll, upper as uuu, lower, lower as xxx
-
-def fred():
- a = 1
- yield a
-