test.py :  » Development » HappyDoc » HappyDoc3-r3_1 » TestCases » Python Open Source

Home
Python Open Source
1.3.1.2 Python
2.Ajax
3.Aspect Oriented
4.Blog
5.Build
6.Business Application
7.Chart Report
8.Content Management Systems
9.Cryptographic
10.Database
11.Development
12.Editor
13.Email
14.ERP
15.Game 2D 3D
16.GIS
17.GUI
18.IDE
19.Installer
20.IRC
21.Issue Tracker
22.Language Interface
23.Log
24.Math
25.Media Sound Audio
26.Mobile
27.Network
28.Parser
29.PDF
30.Project Management
31.RSS
32.Search
33.Security
34.Template Engines
35.Test
36.UML
37.USB Serial
38.Web Frameworks
39.Web Server
40.Web Services
41.Web Unit
42.Wiki
43.Windows
44.XML
Python Open Source » Development » HappyDoc 
HappyDoc » HappyDoc3 r3_1 » TestCases » 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

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.