Update of /cvsroot/happydoc/HappyDoc3/TestCases
In directory usw-pr-cvs1:/tmp/cvs-serv32400/TestCases
Added Files:
__init__.py test.py
Log Message:
Add test files.
--- NEW FILE: __init__.py ---
#!/usr/bin/env python
#
# $Id: __init__.py,v 1.1 2002/11/17 14:51:44 doughellmann Exp $
#
# Copyright 2001 Doug Hellmann.
#
#
# All Rights Reserved
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose and without fee is hereby
# granted, provided that the above copyright notice appear in all
# copies and that both that copyright notice and this permission
# notice appear in supporting documentation, and that the name of Doug
# Hellmann not be used in advertising or publicity pertaining to
# distribution of the software without specific, written prior
# permission.
#
# DOUG HELLMANN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
# NO EVENT SHALL DOUG HELLMANN BE LIABLE FOR ANY SPECIAL, INDIRECT OR
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
# OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
"""Various input files for unit and regression tests.
"""
__rcs_info__ = {
#
# Creation Information
#
'module_name' : '$RCSfile: __init__.py,v $',
'rcs_id' : '$Id: __init__.py,v 1.1 2002/11/17 14:51:44 doughellmann Exp $',
'creator' : 'Doug Hellmann <Dou...@bi...>',
'project' : 'UNSPECIFIED',
'created' : 'Sat, 06-Oct-2001 12:23:43 EDT',
#
# Current Information
#
'author' : '$Author: doughellmann $',
'version' : '$Revision: 1.1 $',
'date' : '$Date: 2002/11/17 14:51:44 $',
}
try:
__version__ = __rcs_info__['version'].split(' ')[1]
except:
__version__ = '0.0'
#
# Import system modules
#
#
# Import Local modules
#
#
# Module
#
--- NEW FILE: test.py ---
#!/usr/bin/python
#
# Here is the module documentation
#
"""Simple test file for HappyDoc.
This module contains various test cases for testing the HappyDoc
documentation generator.
"""
import string
import CommandLineApp
import os, types
import TestCases.test
from sys import path
from token import *
from TestCases.parseinfo.test_nested_structures import OuterClass, OuterFunction
from CommandLineApp import TestApp
class DefaultClassInst:
"Class used for default parameter with a class instance."
pass
class DefaultClassInstWithParams:
"Class used for default parameter with a class instance taking parameters."
def __init__(self, *args):
"Initialize DefaultClassInstWithParams instance."
pass
class DottedBaseClass(CommandLineApp.TestApp):
"Class to test subclassing from a base class with dots in the name."
pass
class MultipleBaseClasses(DefaultClassInst, DefaultClassInstWithParams,
CommandLineApp.CommandLineApp):
"Class testing multiple inheritence."
def __init__(self):
"Initializer"
pass
# Here is a module level variable definition.
foo=1
def example_function_with_args(arg1, arg2,
arg3withDefault='hi there',
arg3aWithDefault="'hi again'",
arg3bWithDefault='"hi there again"',
arg4DefaultInt=101,
arg5DefaultTuple=(1,2),
arg6DefaultList=[3,4],
arg7DefaultNone=None,
arg8DefaultName=foo,
arg9DefaultInstance=DefaultClassInst(),
arg10DefaultInstanceWithParams= \
DefaultClassInstWithParams(1, 2,
('tuple', 'param'),
['list', 'param']
),
stringArgWithHTML='<h1>Hi, Dick & Jane!</h1>',
):
"This is an example function for testing purposes."
if one:
raise IOError('RAISE_class')
else:
raise 'RAISE_blah2'
for i in range(1, 10):
raise 'RAISE_loop'
raise 'RAISE_main_level'
return None
def example_function_without_args():
"This example function has no arguments."
pass
def example_function_with_varargs(*args):
"This example function takes a variable number of arguments."
pass
def example_function_with_kwargs(**kw):
"""
This example function takes variable keyword arguments.
"""
pass
class BaseClass1:
"First base class."
#
# classMember definition example
#
classMember=1
#
# Documentation for method_of_bc1
#
def method_of_bc1(self):
pass
def method2_of_bc1(self):
#
# Documentation for method2_of_bc1 after name
#
pass
class SubClass1(BaseClass1):
"First subclass of BaseClass1."
pass
class BaseClass2:
"Second base class."
pass
class SubClass2(BaseClass1, BaseClass2):
"Second subclass of BaseClass1 and BaseClass2."
def anotherMethod(self):
"A method not defined in the base classes."
pass
#
# Class documentation for SubClass3.
#
# This class documentation section includes a lot of text,
# in several paragraphs.
#
# See, here is another paragraph.
#
# We even have an example:
#
# a -> b -> c -> a
#
# And a bulleted list:
#
# * line one
#
# * line two
#
# * line three
#
class SubClass3(SubClass2, MultipleBaseClasses):
pass
#
# Random comment inserted in text
#
class SubClass4(SubClass1, SubClass3):
#
# Class documentation for SubClass4 after the name
#
pass
#
# External docs for five are skipped because
# of the blank line following the comment block
#
class five:
#
# internal docs for five
#
pass
class OverRecursion:
pass
class OverRecursion(OverRecursion):
pass
|