File: dummyrequest.py

package info (click to toggle)
albatross 1.36-5
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 2,472 kB
  • ctags: 1,822
  • sloc: python: 7,437; makefile: 146; sh: 132
file content (36 lines) | stat: -rw-r--r-- 697 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#
# Copyright 2006 by Object Craft P/L, Melbourne, Australia.
#
# LICENCE - see LICENCE file distributed with this software for details.
#

class DummyRequest:
    """
    Fakes client interactions for testing purposes.
    """
    def __init__(self):
        self.__content = []

    def has_field(self, name):
        pass

    def field_names(self):
        return []

    def write_header(self, name, value):
        pass

    def end_headers(self):
        pass

    def write_content(self, data):
        self.__content.append(data)

    def get_content(self):
        return '\n'.join(self.__content)

    def set_status(self, status):
        pass

    def return_code(self):
        pass