annotate tests/objects.py @ 13:eb81d6943f2e

add another dummy object
author Jeff Hammel <jhammel@mozilla.com>
date Fri, 27 May 2011 07:22:40 -0700
parents ff272dcd5cd8
children 0bea5297c156
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11
ff272dcd5cd8 we have a passing test
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
1 """
ff272dcd5cd8 we have a passing test
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
2 test objects
ff272dcd5cd8 we have a passing test
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
3 """
ff272dcd5cd8 we have a passing test
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
4
ff272dcd5cd8 we have a passing test
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
5 def stringsort(*strings):
ff272dcd5cd8 we have a passing test
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
6 return ''.join(sorted(''.join(strings)))
13
eb81d6943f2e add another dummy object
Jeff Hammel <jhammel@mozilla.com>
parents: 11
diff changeset
7
eb81d6943f2e add another dummy object
Jeff Hammel <jhammel@mozilla.com>
parents: 11
diff changeset
8 class Foo(object):
eb81d6943f2e add another dummy object
Jeff Hammel <jhammel@mozilla.com>
parents: 11
diff changeset
9 def __init__(self, a, b):
eb81d6943f2e add another dummy object
Jeff Hammel <jhammel@mozilla.com>
parents: 11
diff changeset
10 self.factor = a*100 + b
eb81d6943f2e add another dummy object
Jeff Hammel <jhammel@mozilla.com>
parents: 11
diff changeset
11 def __call__(self, number):
eb81d6943f2e add another dummy object
Jeff Hammel <jhammel@mozilla.com>
parents: 11
diff changeset
12 return number * self.factor