summary refs log blame commit diff stats
path: root/test/__init__.py
blob: 86557b6a79a02df2ad8845220b2d21b73c20e678 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background
import os, sys

__all__ = [ x[0:x.index('.')] \
		for x in os.listdir(os.path.dirname(__file__)) \
		if x.startswith('tc_') ]

def init():
	sys.path.append(os.path.abspath(os.path.join(sys.path[0], '..')))

class Fake(object):
	def __getattr__(self, attrname):
		val = Fake()
		self.__dict__[attrname] = val
		return val

	def __call__(self, *_):
		return Fake()

	def __clear__(self):
		self.__dict__.clear()

	def __iter__(self):
		return iter(())

class OK(Exception):
	pass

def raise_ok(*_, **__):
	raise OK()
p">[-1] except IndexError: try: return self.history[-1] except IndexError: raise HistoryEmptyException() def bottom(self): try: return self.history[0] except IndexError: raise HistoryEmptyException() def back(self): if len(self.history) > 1: self.history_forward.appendleft( self.history.pop() ) return self.current() def move(self, n): if n > 0: return self.forward() if n < 0: return self.back() def __iter__(self): return self.history.__iter__() def next(self): return self.history.next() def forward(self): if len(self.history_forward) > 0: self.history.append( self.history_forward.popleft() ) return self.current() def fast_forward(self): if self.history_forward: self.history.extend(self.history_forward) self.history_forward.clear()