rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
>>> class Seq: ... def __getitem__(self, i): ... if i >= 0 and i < 3: return i ... raise IndexError ... >>> a, b, c = Seq() >>> a == 0 and b == 1 and c == 2 True
def __getitem__(self, i): if i >= 0 and i < 3: return i raise IndexError
3981511070311e958bd2cd48b1ab16b24f8b350e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3981511070311e958bd2cd48b1ab16b24f8b350e/test_unpack.py
if verbose: print 'unpack non-sequence' try: a, b, c = 7 raise TestFailed except TypeError: pass
Single element unpacking, with extra syntax
def __getitem__(self, i): if i >= 0 and i < 3: return i raise IndexError
3981511070311e958bd2cd48b1ab16b24f8b350e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3981511070311e958bd2cd48b1ab16b24f8b350e/test_unpack.py
if verbose: print 'unpack tuple wrong size' try: a, b = t raise TestFailed except ValueError: pass
Now for some failures
def __getitem__(self, i): if i >= 0 and i < 3: return i raise IndexError
3981511070311e958bd2cd48b1ab16b24f8b350e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3981511070311e958bd2cd48b1ab16b24f8b350e/test_unpack.py
if verbose: print 'unpack list wrong size' try: a, b = l raise TestFailed except ValueError: pass
Unpacking non-sequence
def __getitem__(self, i): if i >= 0 and i < 3: return i raise IndexError
3981511070311e958bd2cd48b1ab16b24f8b350e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3981511070311e958bd2cd48b1ab16b24f8b350e/test_unpack.py
if verbose: print 'unpack sequence too short' try: a, b, c, d = Seq() raise TestFailed except ValueError: pass
Unpacking tuple of wrong size
def __getitem__(self, i): if i >= 0 and i < 3: return i raise IndexError
3981511070311e958bd2cd48b1ab16b24f8b350e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3981511070311e958bd2cd48b1ab16b24f8b350e/test_unpack.py
if verbose: print 'unpack sequence too long' try: a, b = Seq() raise TestFailed except ValueError: pass
Unpacking tuple of wrong size
def __getitem__(self, i): if i >= 0 and i < 3: return i raise IndexError
3981511070311e958bd2cd48b1ab16b24f8b350e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3981511070311e958bd2cd48b1ab16b24f8b350e/test_unpack.py
class BozoError(Exception): pass
Unpacking sequence too short
def __getitem__(self, i): if i >= 0 and i < 3: return i raise IndexError
3981511070311e958bd2cd48b1ab16b24f8b350e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3981511070311e958bd2cd48b1ab16b24f8b350e/test_unpack.py
class BadSeq: def __getitem__(self, i): if i >= 0 and i < 3: return i elif i == 3: raise BozoError else: raise IndexError
>>> a, b, c, d = Seq() Traceback (most recent call last): ... ValueError: need more than 3 values to unpack
def __getitem__(self, i): if i >= 0 and i < 3: return i raise IndexError
3981511070311e958bd2cd48b1ab16b24f8b350e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3981511070311e958bd2cd48b1ab16b24f8b350e/test_unpack.py
if verbose: print 'unpack sequence too long, wrong error' try: a, b, c, d, e = BadSeq() raise TestFailed except BozoError: pass
>>> a, b = Seq() Traceback (most recent call last): ... ValueError: too many values to unpack
def __getitem__(self, i): if i >= 0 and i < 3: return i elif i == 3: raise BozoError else: raise IndexError
3981511070311e958bd2cd48b1ab16b24f8b350e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3981511070311e958bd2cd48b1ab16b24f8b350e/test_unpack.py
if verbose: print 'unpack sequence too short, wrong error' try: a, b, c = BadSeq() raise TestFailed except BozoError: pass
Unpacking a sequence where the test for too long raises a different kind of error >>> class BozoError(Exception): ... pass ... >>> class BadSeq: ... def __getitem__(self, i): ... if i >= 0 and i < 3: ... return i ... elif i == 3: ... raise BozoError ... else: ......
def __getitem__(self, i): if i >= 0 and i < 3: return i elif i == 3: raise BozoError else: raise IndexError
3981511070311e958bd2cd48b1ab16b24f8b350e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3981511070311e958bd2cd48b1ab16b24f8b350e/test_unpack.py
self.d.GetDialogWindow().ShowWindow()
self.w.ShowWindow()
def __init__(self, title="Working...", maxval=100, label="", id=263): self.maxval = maxval self.curval = -1 self.d = GetNewDialog(id, -1) self.label(label) self._update(0) self.d.AutoSizeDialog() self.title(title) self.d.GetDialogWindow().ShowWindow() self.d.DrawDialog()
784c61105343c2d4180128c382b65f48028dd8a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/784c61105343c2d4180128c382b65f48028dd8a3/EasyDialogs.py
self.d.BringToFront() self.d.HideWindow()
self.w.BringToFront() self.w.HideWindow() del self.w
def __del__( self ): self.d.BringToFront() self.d.HideWindow() del self.d
784c61105343c2d4180128c382b65f48028dd8a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/784c61105343c2d4180128c382b65f48028dd8a3/EasyDialogs.py
w = self.d.GetDialogWindow() w.BringToFront() w.SetWTitle(newstr)
self.w.BringToFront() self.w.SetWTitle(newstr)
def title(self, newstr=""): """title(text) - Set title of progress window""" w = self.d.GetDialogWindow() w.BringToFront() w.SetWTitle(newstr)
784c61105343c2d4180128c382b65f48028dd8a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/784c61105343c2d4180128c382b65f48028dd8a3/EasyDialogs.py
self.d.GetDialogWindow().BringToFront()
self.w.BringToFront()
def label( self, *newstr ): """label(text) - Set text in progress box""" self.d.GetDialogWindow().BringToFront() if newstr: self._label = lf2cr(newstr[0]) text_h = self.d.GetDialogItemAsControl(2) SetDialogItemText(text_h, self._label)
784c61105343c2d4180128c382b65f48028dd8a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/784c61105343c2d4180128c382b65f48028dd8a3/EasyDialogs.py
raise TestFailed, "NotImplemented should have caused TypeErrpr"
raise TestFailed, "NotImplemented should have caused TypeError"
def __add__(self, other): return NotImplemented
1af5e35a98008e5eb6406dc4f4ff831eee23a0e5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1af5e35a98008e5eb6406dc4f4ff831eee23a0e5/test_descr.py
import os, fcntl
import os try: import fcntl except ImportError: fcntl = None
def export_add(self, x, y): return x + y
e29002ccb009966bc23d632f534d62bad56d0fd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e29002ccb009966bc23d632f534d62bad56d0fd3/SimpleXMLRPCServer.py
if hasattr(fcntl, 'FD_CLOEXEC'):
if fcntl is not None and hasattr(fcntl, 'FD_CLOEXEC'):
def __init__(self, addr, requestHandler=SimpleXMLRPCRequestHandler, logRequests=True, allow_none=False, encoding=None): self.logRequests = logRequests
e29002ccb009966bc23d632f534d62bad56d0fd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e29002ccb009966bc23d632f534d62bad56d0fd3/SimpleXMLRPCServer.py
if status != 100:
if status != CONTINUE:
def begin(self): if self.msg is not None: # we've already started reading the response return
39a317890fa7651e8f124c1a566af5f7a72da792 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/39a317890fa7651e8f124c1a566af5f7a72da792/httplib.py
if (status == 204 or status == 304 or
if (status == NO_CONTENT or status == NOT_MODIFIED or
def begin(self): if self.msg is not None: # we've already started reading the response return
39a317890fa7651e8f124c1a566af5f7a72da792 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/39a317890fa7651e8f124c1a566af5f7a72da792/httplib.py
try: str(u'Hello \u00E1') except Exception, e: sampleUnicodeEncodeError = e try: unicode('\xff') except Exception, e: sampleUnicodeDecodeError = e
try: str(u'Hello \u00E1') except Exception, e: sampleUnicodeEncodeError = e try: unicode('\xff') except Exception, e: sampleUnicodeDecodeError = e
def testAttributes(self): # test that exception attributes are happy try: str(u'Hello \u00E1') except Exception, e: sampleUnicodeEncodeError = e
80dc76e9072c4adaedf5c52032699b859c82eca2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/80dc76e9072c4adaedf5c52032699b859c82eca2/test_exceptions.py
except NameError: pass import pickle, random
except NameError: pass
def testAttributes(self): # test that exception attributes are happy try: str(u'Hello \u00E1') except Exception, e: sampleUnicodeEncodeError = e
80dc76e9072c4adaedf5c52032699b859c82eca2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/80dc76e9072c4adaedf5c52032699b859c82eca2/test_exceptions.py
if len(args) == 2: raise exc else: raise exc(*args[1])
if len(args) == 2: raise exc else: raise exc(*args[1])
def testAttributes(self): # test that exception attributes are happy try: str(u'Hello \u00E1') except Exception, e: sampleUnicodeEncodeError = e
80dc76e9072c4adaedf5c52032699b859c82eca2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/80dc76e9072c4adaedf5c52032699b859c82eca2/test_exceptions.py
type(e) is not exc):
type(e) is not exc):
def testAttributes(self): # test that exception attributes are happy try: str(u'Hello \u00E1') except Exception, e: sampleUnicodeEncodeError = e
80dc76e9072c4adaedf5c52032699b859c82eca2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/80dc76e9072c4adaedf5c52032699b859c82eca2/test_exceptions.py
new = pickle.loads(pickle.dumps(e, random.randint(0, 2))) for checkArgName in expected: self.assertEquals(repr(getattr(e, checkArgName)), repr(expected[checkArgName]), 'pickled exception "%s", attribute "%s' % (repr(e), checkArgName))
for p in pickle, cPickle: for protocol in range(p.HIGHEST_PROTOCOL + 1): new = p.loads(p.dumps(e, protocol)) for checkArgName in expected: got = repr(getattr(new, checkArgName)) want = repr(expected[checkArgName]) self.assertEquals(got, want, 'pickled "%r", attribute "%s' % (e, checkArgName))
def testAttributes(self): # test that exception attributes are happy try: str(u'Hello \u00E1') except Exception, e: sampleUnicodeEncodeError = e
80dc76e9072c4adaedf5c52032699b859c82eca2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/80dc76e9072c4adaedf5c52032699b859c82eca2/test_exceptions.py
if not included: self._version = dict.get('Version', '0.1') if self._version != PIMP_VERSION: sys.stderr.write("Warning: database version %s does not match %s\n"
if included: version = dict.get('Version') if version and version > self._version: sys.stderr.write("Warning: included database %s is for pimp version %s\n" % (url, version)) else: self._version = dict.get('Version') if not self._version: sys.stderr.write("Warning: database has no Version information\n") elif self._ver...
def appendURL(self, url, included=0): """Append packages from the database with the given URL. Only the first database should specify included=0, so the global information (maintainer, description) get stored.""" if url in self._urllist: return self._urllist.append(url) fp = urllib2.urlopen(url).fp dict = plistlib.Pli...
b789a060ee0ac49785ce6718f0da5abf19a1629a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b789a060ee0ac49785ce6718f0da5abf19a1629a/pimp.py
print " -D dir Set destination directory (default: site-packages)"
print " -D dir Set destination directory" print " (default: %s)" % DEFAULT_INSTALLDIR print " -u url URL for database" print " (default: %s)" % DEFAULT_PIMPDATABASE
def _help(): print "Usage: pimp [options] -s [package ...] List installed status" print " pimp [options] -l [package ...] Show package information" print " pimp [options] -i package ... Install packages" print " pimp -d Dump database to stdout" print "Options:" print " ...
b789a060ee0ac49785ce6718f0da5abf19a1629a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b789a060ee0ac49785ce6718f0da5abf19a1629a/pimp.py
opts, args = getopt.getopt(sys.argv[1:], "slifvdD:") except getopt.Error:
opts, args = getopt.getopt(sys.argv[1:], "slifvdD:Vu:") except getopt.GetoptError:
def _help(): print "Usage: pimp [options] -s [package ...] List installed status" print " pimp [options] -l [package ...] Show package information" print " pimp [options] -i package ... Install packages" print " pimp -d Dump database to stdout" print "Options:" print " ...
b789a060ee0ac49785ce6718f0da5abf19a1629a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b789a060ee0ac49785ce6718f0da5abf19a1629a/pimp.py
_run(mode, verbose, force, args, prefargs)
if mode == 'version': print 'Pimp version %s; module name is %s' % (PIMP_VERSION, __name__) else: _run(mode, verbose, force, args, prefargs) if __name__ != 'pimp_update': try: import pimp_update except ImportError: pass else: if pimp_update.PIMP_VERSION <= PIMP_VERSION: import warnings warnings.warn("pimp_update i...
def _help(): print "Usage: pimp [options] -s [package ...] List installed status" print " pimp [options] -l [package ...] Show package information" print " pimp [options] -i package ... Install packages" print " pimp -d Dump database to stdout" print "Options:" print " ...
b789a060ee0ac49785ce6718f0da5abf19a1629a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b789a060ee0ac49785ce6718f0da5abf19a1629a/pimp.py
n = 100
n = 200
def test_tee(self): n = 100 def irange(n): for i in xrange(n): yield i
ad983e79d6f215235d205245c2599620e33cf719 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ad983e79d6f215235d205245c2599620e33cf719/test_itertools.py
self.assertEqual(a.next(), 0) self.assertEqual(a.next(), 1)
for i in xrange(100): self.assertEqual(a.next(), i)
def irange(n): for i in xrange(n): yield i
ad983e79d6f215235d205245c2599620e33cf719 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ad983e79d6f215235d205245c2599620e33cf719/test_itertools.py
self.assertEqual(a.next(), 0) self.assertEqual(a.next(), 1)
for i in xrange(100): self.assertEqual(a.next(), i)
def irange(n): for i in xrange(n): yield i
ad983e79d6f215235d205245c2599620e33cf719 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ad983e79d6f215235d205245c2599620e33cf719/test_itertools.py
self.assertEqual(list(a), range(2, n))
self.assertEqual(list(a), range(100, n))
def irange(n): for i in xrange(n): yield i
ad983e79d6f215235d205245c2599620e33cf719 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ad983e79d6f215235d205245c2599620e33cf719/test_itertools.py
try: class A(tee): pass except TypeError: pass else: self.fail("tee constructor should not be subclassable") a, b = tee(xrange(10)) self.assertRaises(TypeError, type(a)) self.assert_(a is iter(a))
self.assertRaises(TypeError, tee, [1,2], 3, 'x') a, b = tee('abc') c = type(a)('def') self.assertEqual(list(c), list('def')) a, b, c = tee(xrange(2000), 3) for i in xrange(100): self.assertEqual(a.next(), i) self.assertEqual(list(b), range(2000)) self.assertEqual([c.next(), c.next()], range(2)) self.assertEqual(lis...
def irange(n): for i in xrange(n): yield i
ad983e79d6f215235d205245c2599620e33cf719 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ad983e79d6f215235d205245c2599620e33cf719/test_itertools.py
def test_tee(self): a = [] p, q = t = tee([a]*2) a += [a, p, q, t] p.next() del a, p, q, t
def test_starmap(self): a = [] self.makecycle(starmap(lambda *t: t, [(a,a)]*2), a)
ad983e79d6f215235d205245c2599620e33cf719 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ad983e79d6f215235d205245c2599620e33cf719/test_itertools.py
... return izip(a, islice(b, 1, None))
... try: ... b.next() ... except StopIteration: ... pass ... return izip(a, b)
>>> def pairwise(iterable):
ad983e79d6f215235d205245c2599620e33cf719 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ad983e79d6f215235d205245c2599620e33cf719/test_itertools.py
print>>sys.__stderr__, "Idle accepted connection from ", address
def accept(self): working_sock, address = self.listening_sock.accept() if address[0] == '127.0.0.1': print>>sys.__stderr__, "Idle accepted connection from ", address SocketIO.__init__(self, working_sock) else: print>>sys.__stderr__, "Invalid host: ", address raise socket.error
74d93c81c190f9dfd7302e17536a49b8dd4f7da6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/74d93c81c190f9dfd7302e17536a49b8dd4f7da6/rpc.py
print>>sys.__stderr__, "Invalid host: ", address
print>>sys.__stderr__, "** Invalid host: ", address
def accept(self): working_sock, address = self.listening_sock.accept() if address[0] == '127.0.0.1': print>>sys.__stderr__, "Idle accepted connection from ", address SocketIO.__init__(self, working_sock) else: print>>sys.__stderr__, "Invalid host: ", address raise socket.error
74d93c81c190f9dfd7302e17536a49b8dd4f7da6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/74d93c81c190f9dfd7302e17536a49b8dd4f7da6/rpc.py
def __init__(self, completekey='tab'):
def __init__(self, completekey='tab', stdin=None, stdout=None):
def __init__(self, completekey='tab'): """Instantiate a line-oriented interpreter framework.
983b00882400986b292837a25ef866fc897d603b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/983b00882400986b292837a25ef866fc897d603b/cmd.py
The optional argument is the readline name of a completion key; it defaults to the Tab key. If completekey is not None and the readline module is available, command completion is done automatically. """
The optional argument 'completekey' is the readline name of a completion key; it defaults to the Tab key. If completekey is not None and the readline module is available, command completion is done automatically. The optional arguments stdin and stdout specify alternate input and output file objects; if not specified, ...
def __init__(self, completekey='tab'): """Instantiate a line-oriented interpreter framework.
983b00882400986b292837a25ef866fc897d603b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/983b00882400986b292837a25ef866fc897d603b/cmd.py
print self.intro
self.stdout.write(str(self.intro)+"\n")
def cmdloop(self, intro=None): """Repeatedly issue a prompt, accept input, parse an initial prefix off the received input, and dispatch to action methods, passing them the remainder of the line as argument.
983b00882400986b292837a25ef866fc897d603b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/983b00882400986b292837a25ef866fc897d603b/cmd.py
sys.stdout.write(self.prompt) sys.stdout.flush() line = sys.stdin.readline()
self.stdout.write(self.prompt) self.stdout.flush() line = self.stdin.readline()
def cmdloop(self, intro=None): """Repeatedly issue a prompt, accept input, parse an initial prefix off the received input, and dispatch to action methods, passing them the remainder of the line as argument.
983b00882400986b292837a25ef866fc897d603b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/983b00882400986b292837a25ef866fc897d603b/cmd.py
print '*** Unknown syntax:', line
self.stdout.write('*** Unknown syntax: %s\n'%line)
def default(self, line): """Called on an input line when the command prefix is not recognized.
983b00882400986b292837a25ef866fc897d603b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/983b00882400986b292837a25ef866fc897d603b/cmd.py
print doc
self.stdout.write("%s\n"%str(doc))
def do_help(self, arg): if arg: # XXX check arg syntax try: func = getattr(self, 'help_' + arg) except AttributeError: try: doc=getattr(self, 'do_' + arg).__doc__ if doc: print doc return except AttributeError: pass print self.nohelp % (arg,) return func() else: names = self.get_names() cmds_doc = [] cmds_undoc = [] he...
983b00882400986b292837a25ef866fc897d603b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/983b00882400986b292837a25ef866fc897d603b/cmd.py
print self.nohelp % (arg,)
self.stdout.write("%s\n"%str(self.nohelp % (arg,)))
def do_help(self, arg): if arg: # XXX check arg syntax try: func = getattr(self, 'help_' + arg) except AttributeError: try: doc=getattr(self, 'do_' + arg).__doc__ if doc: print doc return except AttributeError: pass print self.nohelp % (arg,) return func() else: names = self.get_names() cmds_doc = [] cmds_undoc = [] he...
983b00882400986b292837a25ef866fc897d603b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/983b00882400986b292837a25ef866fc897d603b/cmd.py
print self.doc_leader
self.stdout.write("%s\n"%str(self.doc_leader))
def do_help(self, arg): if arg: # XXX check arg syntax try: func = getattr(self, 'help_' + arg) except AttributeError: try: doc=getattr(self, 'do_' + arg).__doc__ if doc: print doc return except AttributeError: pass print self.nohelp % (arg,) return func() else: names = self.get_names() cmds_doc = [] cmds_undoc = [] he...
983b00882400986b292837a25ef866fc897d603b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/983b00882400986b292837a25ef866fc897d603b/cmd.py
print header
self.stdout.write("%s\n"%str(header))
def print_topics(self, header, cmds, cmdlen, maxcol): if cmds: print header if self.ruler: print self.ruler * len(header) self.columnize(cmds, maxcol-1) print
983b00882400986b292837a25ef866fc897d603b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/983b00882400986b292837a25ef866fc897d603b/cmd.py
print self.ruler * len(header)
self.stdout.write("%s\n"%str(self.ruler * len(header)))
def print_topics(self, header, cmds, cmdlen, maxcol): if cmds: print header if self.ruler: print self.ruler * len(header) self.columnize(cmds, maxcol-1) print
983b00882400986b292837a25ef866fc897d603b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/983b00882400986b292837a25ef866fc897d603b/cmd.py
print
self.stdout.write("\n")
def print_topics(self, header, cmds, cmdlen, maxcol): if cmds: print header if self.ruler: print self.ruler * len(header) self.columnize(cmds, maxcol-1) print
983b00882400986b292837a25ef866fc897d603b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/983b00882400986b292837a25ef866fc897d603b/cmd.py
print "<empty>"
self.stdout.write("<empty>\n")
def columnize(self, list, displaywidth=80): """Display a list of strings as a compact set of columns.
983b00882400986b292837a25ef866fc897d603b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/983b00882400986b292837a25ef866fc897d603b/cmd.py
print list[0]
self.stdout.write('%s\n'%str(list[0]))
def columnize(self, list, displaywidth=80): """Display a list of strings as a compact set of columns.
983b00882400986b292837a25ef866fc897d603b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/983b00882400986b292837a25ef866fc897d603b/cmd.py
print " ".join(texts)
self.stdout.write("%s\n"%str(" ".join(texts)))
def columnize(self, list, displaywidth=80): """Display a list of strings as a compact set of columns.
983b00882400986b292837a25ef866fc897d603b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/983b00882400986b292837a25ef866fc897d603b/cmd.py
self.__messages.setdefault(msg, []).append(entry)
self.__messages.setdefault(msg, {})[entry] = 1
def __addentry(self, msg, lineno=None): if lineno is None: lineno = self.__lineno if not msg in self.__options.toexclude: entry = (self.__curfile, lineno) self.__messages.setdefault(msg, []).append(entry)
6e972414bec063ce953df9dea5a13239ac7e5604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6e972414bec063ce953df9dea5a13239ac7e5604/pygettext.py
sys.stderr.write(_("Can't read --exclude-file: %s") % options.excludefilename)
print >> sys.stderr, _( "Can't read --exclude-file: %s") % options.excludefilename
def main(): global default_keywords try: opts, args = getopt.getopt( sys.argv[1:], 'ad:DEhk:Kno:p:S:Vvw:x:', ['extract-all', 'default-domain', 'escape', 'help', 'keyword=', 'no-default-keywords', 'add-location', 'no-location', 'output=', 'output-dir=', 'style=', 'verbose', 'version', 'width=', 'exclude-file=', 'docstri...
6e972414bec063ce953df9dea5a13239ac7e5604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6e972414bec063ce953df9dea5a13239ac7e5604/pygettext.py
sys.stderr.write('%s: %s, line %d, column %d\n' % (e[0], filename, e[1][0], e[1][1]))
print >> sys.stderr, '%s: %s, line %d, column %d' % ( e[0], filename, e[1][0], e[1][1])
def main(): global default_keywords try: opts, args = getopt.getopt( sys.argv[1:], 'ad:DEhk:Kno:p:S:Vvw:x:', ['extract-all', 'default-domain', 'escape', 'help', 'keyword=', 'no-default-keywords', 'add-location', 'no-location', 'output=', 'output-dir=', 'style=', 'verbose', 'version', 'width=', 'exclude-file=', 'docstri...
6e972414bec063ce953df9dea5a13239ac7e5604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6e972414bec063ce953df9dea5a13239ac7e5604/pygettext.py
for name in ('lib', 'purelib', 'platlib',
for name in ('libbase', 'lib', 'purelib', 'platlib',
def finalize_options (self):
1b024d37a7e56279db00c7d775397f19927736a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1b024d37a7e56279db00c7d775397f19927736a9/install.py
st = os.lstat(name)
try: st = os.lstat(name) except os.error: continue
def walk(top, func, arg): """walk(top,func,arg) calls func(arg, d, files) for each directory "d" in the tree rooted at "top" (including "top" itself). "files" is a list of all the files and subdirs in directory "d". """ try: names = os.listdir(top) except os.error: return func(arg, top, names) for name in names: name...
a490d5856dc0bcfbb286feb76dbc5e7a4edddef8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a490d5856dc0bcfbb286feb76dbc5e7a4edddef8/posixpath.py
instance.menuRecentFiles.delete(1,END)
menu = instance.menuRecentFiles menu.delete(1,END) i = 0 ; ul = 0; ullen = len(ullist)
def UpdateRecentFilesList(self,newFile=None): "Load or update the recent files list, and menu if required" rfList=[] if os.path.exists(self.recentFilesPath): RFfile=open(self.recentFilesPath,'r') try: rfList=RFfile.readlines() finally: RFfile.close() if newFile: newFile=os.path.abspath(newFile)+'\n' if newFile in rfLis...
c9a5b5c72e6017c154b26d2796141091e7614d44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c9a5b5c72e6017c154b26d2796141091e7614d44/EditorWindow.py
instance.menuRecentFiles.add_command(label=fileName, command=instance.__RecentFileCallback(fileName))
callback = instance.__RecentFileCallback(fileName) if i > ullen: ul=None menu.add_command(label=ullist[i] + " " + fileName, command=callback, underline=ul) i += 1
def UpdateRecentFilesList(self,newFile=None): "Load or update the recent files list, and menu if required" rfList=[] if os.path.exists(self.recentFilesPath): RFfile=open(self.recentFilesPath,'r') try: rfList=RFfile.readlines() finally: RFfile.close() if newFile: newFile=os.path.abspath(newFile)+'\n' if newFile in rfLis...
c9a5b5c72e6017c154b26d2796141091e7614d44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c9a5b5c72e6017c154b26d2796141091e7614d44/EditorWindow.py
def write(self, arg, move=0): x, y = start = self._position
def write(self, text, move=False): """ Write text at the current pen position. If move is true, the pen is moved to the bottom-right corner of the text. By default, move is False. Example: >>> turtle.write('The race is on!') >>> turtle.write('Home = (0, 0)', True) """ x, y = self._position
def write(self, arg, move=0): x, y = start = self._position x = x-1 # correction -- calibrated for Windows item = self._canvas.create_text(x, y, text=str(arg), anchor="sw", fill=self._color) self._items.append(item) if move: x0, y0, x1, y1 = self._canvas.bbox(item) self._goto(x1, y1) self._draw_turtle()
e3a25838db0ac392aa9e68379e167635f8e67a43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e3a25838db0ac392aa9e68379e167635f8e67a43/turtle.py
text=str(arg), anchor="sw",
text=str(text), anchor="sw",
def write(self, arg, move=0): x, y = start = self._position x = x-1 # correction -- calibrated for Windows item = self._canvas.create_text(x, y, text=str(arg), anchor="sw", fill=self._color) self._items.append(item) if move: x0, y0, x1, y1 = self._canvas.bbox(item) self._goto(x1, y1) self._draw_turtle()
e3a25838db0ac392aa9e68379e167635f8e67a43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e3a25838db0ac392aa9e68379e167635f8e67a43/turtle.py
self._canvas.lower(item)
def fill(self, flag): if self._filling: path = tuple(self._path) smooth = self._filling < 0 if len(path) > 2: item = self._canvas._create('polygon', path, {'fill': self._color, 'smooth': smooth}) self._items.append(item) self._canvas.lower(item) if self._tofill: for item in self._tofill: self._canvas.itemconfigure(item...
e3a25838db0ac392aa9e68379e167635f8e67a43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e3a25838db0ac392aa9e68379e167635f8e67a43/turtle.py
start = self._angle - 90.0
start = self._angle - (self._fullcircle / 4.0)
def circle(self, radius, extent=None): if extent is None: extent = self._fullcircle x0, y0 = self._position xc = x0 - radius * sin(self._angle * self._invradian) yc = y0 - radius * cos(self._angle * self._invradian) if radius >= 0.0: start = self._angle - 90.0 else: start = self._angle + 90.0 extent = -extent if self._...
e3a25838db0ac392aa9e68379e167635f8e67a43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e3a25838db0ac392aa9e68379e167635f8e67a43/turtle.py
start = self._angle + 90.0
start = self._angle + (self._fullcircle / 4.0)
def circle(self, radius, extent=None): if extent is None: extent = self._fullcircle x0, y0 = self._position xc = x0 - radius * sin(self._angle * self._invradian) yc = y0 - radius * cos(self._angle * self._invradian) if radius >= 0.0: start = self._angle - 90.0 else: start = self._angle + 90.0 extent = -extent if self._...
e3a25838db0ac392aa9e68379e167635f8e67a43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e3a25838db0ac392aa9e68379e167635f8e67a43/turtle.py
x0, y0 = start = self._position
x0, y0 = self._position
def _goto(self, x1, y1): x0, y0 = start = self._position self._position = map(float, (x1, y1)) if self._filling: self._path.append(self._position) if self._drawing: if self._tracing: dx = float(x1 - x0) dy = float(y1 - y0) distance = hypot(dx, dy) nhops = int(distance) item = self._canvas.create_line(x0, y0, x0, y0, wi...
e3a25838db0ac392aa9e68379e167635f8e67a43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e3a25838db0ac392aa9e68379e167635f8e67a43/turtle.py
self._canvas.after(10)
self._canvas.after(self._delay)
def _goto(self, x1, y1): x0, y0 = start = self._position self._position = map(float, (x1, y1)) if self._filling: self._path.append(self._position) if self._drawing: if self._tracing: dx = float(x1 - x0) dy = float(y1 - y0) distance = hypot(dx, dy) nhops = int(distance) item = self._canvas.create_line(x0, y0, x0, y0, wi...
e3a25838db0ac392aa9e68379e167635f8e67a43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e3a25838db0ac392aa9e68379e167635f8e67a43/turtle.py
def _draw_turtle(self,position=[]):
def speed(self, speed): """ Set the turtle's speed. speed must one of these five strings: 'fastest' is a 0 ms delay 'fast' is a 5 ms delay 'normal' is a 10 ms delay 'slow' is a 15 ms delay 'slowest' is a 20 ms delay Example: >>> turtle.speed('slow') """ try: speed = speed.strip().lower() self._delay = speeds.index(s...
def _draw_turtle(self,position=[]): if not self._tracing: return if position == []: position = self._position x,y = position distance = 8 dx = distance * cos(self._angle*self._invradian) dy = distance * sin(self._angle*self._invradian) self._delete_turtle() self._arrow = self._canvas.create_line(x-dx,y+dy,x,y, width=se...
e3a25838db0ac392aa9e68379e167635f8e67a43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e3a25838db0ac392aa9e68379e167635f8e67a43/turtle.py
self._arrow = 0
self._arrow = 0
def _delete_turtle(self): if self._arrow != 0: self._canvas.delete(self._arrow) self._arrow = 0
e3a25838db0ac392aa9e68379e167635f8e67a43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e3a25838db0ac392aa9e68379e167635f8e67a43/turtle.py
def _destroy(self): global _root, _canvas, _pen root = self._canvas._root() if root is _root: _pen = None _root = None _canvas = None root.destroy()
e3a25838db0ac392aa9e68379e167635f8e67a43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e3a25838db0ac392aa9e68379e167635f8e67a43/turtle.py
pen = _pen if not pen: _pen = pen = Pen() return pen
if not _pen: _pen = Pen() return _pen class Turtle(Pen): pass """For documentation of the following functions see the RawPen methods with the same names """
def _getpen(): global _pen pen = _pen if not pen: _pen = pen = Pen() return pen
e3a25838db0ac392aa9e68379e167635f8e67a43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e3a25838db0ac392aa9e68379e167635f8e67a43/turtle.py
if __name__ == '__main__': _root.mainloop()
def demo2(): speed('fast') width(3) setheading(towards(0,0)) x,y = position() r = (x**2+y**2)**.5/2.0 right(90) pendown = True for i in range(18): if pendown: up() pendown = False else: down() pendown = True circle(r,10) sleep(2) reset() left(90) l = 10 color("green") width(3) left(180) sp = 5 for i in range(-2,...
def demo(): reset() tracer(1) up() backward(100) down() # draw 3 squares; the last filled width(3) for i in range(3): if i == 2: fill(1) for j in range(4): forward(20) left(90) if i == 2: color("maroon") fill(0) up() forward(30) down() width(1) color("black") # move out of the way tracer(0) up() right(90) forward(100) ...
e3a25838db0ac392aa9e68379e167635f8e67a43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e3a25838db0ac392aa9e68379e167635f8e67a43/turtle.py
('file://nonsensename/etc/passwd', None, (OSError, socket.error))
('file://nonsensename/etc/passwd', None, (EnvironmentError, socket.error))
def test_file(self): TESTFN = test_support.TESTFN f = open(TESTFN, 'w') try: f.write('hi there\n') f.close() urls = [ 'file:'+sanepathname2url(os.path.abspath(TESTFN)),
896c1ea15e9ec67fd1b33998ba8daaf17528ba31 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/896c1ea15e9ec67fd1b33998ba8daaf17528ba31/test_urllib2net.py
Optional keyword arg "name" gives the name of the file; by default use the file's name.
Optional keyword arg "name" gives the name of the test; by default use the file's basename.
def testfile(filename, module_relative=True, name=None, package=None, globs=None, verbose=None, report=True, optionflags=0, extraglobs=None, raise_on_error=False): """ Test examples in the given file. Return (#failures, #tests). Optional keyword arg "module_relative" specifies how filenames should be interpreted: - ...
a2fc7ec80aea43768c11c50922a665a08b3885c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a2fc7ec80aea43768c11c50922a665a08b3885c0/doctest.py
name = os.path.split(filename)[-1]
name = os.path.basename(filename)
def testfile(filename, module_relative=True, name=None, package=None, globs=None, verbose=None, report=True, optionflags=0, extraglobs=None, raise_on_error=False): """ Test examples in the given file. Return (#failures, #tests). Optional keyword arg "module_relative" specifies how filenames should be interpreted: - ...
a2fc7ec80aea43768c11c50922a665a08b3885c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a2fc7ec80aea43768c11c50922a665a08b3885c0/doctest.py
package The name of a Python package. Text-file paths will be interpreted relative to the directory containing this package. The package may be supplied as a package object or as a dotted package name.
def DocTestSuite(module=None, globs=None, extraglobs=None, test_finder=None, **options): """ Convert doctest tests for a module to a unittest test suite. This converts each documentation string in a module that contains doctest tests to a unittest test case. If any of the tests in a doc string fail, then the test cas...
a2fc7ec80aea43768c11c50922a665a08b3885c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a2fc7ec80aea43768c11c50922a665a08b3885c0/doctest.py
The name of a set-up function. This is called before running the
A set-up function. This is called before running the
def DocTestSuite(module=None, globs=None, extraglobs=None, test_finder=None, **options): """ Convert doctest tests for a module to a unittest test suite. This converts each documentation string in a module that contains doctest tests to a unittest test case. If any of the tests in a doc string fail, then the test cas...
a2fc7ec80aea43768c11c50922a665a08b3885c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a2fc7ec80aea43768c11c50922a665a08b3885c0/doctest.py
The name of a tear-down function. This is called after running the
A tear-down function. This is called after running the
def DocTestSuite(module=None, globs=None, extraglobs=None, test_finder=None, **options): """ Convert doctest tests for a module to a unittest test suite. This converts each documentation string in a module that contains doctest tests to a unittest test case. If any of the tests in a doc string fail, then the test cas...
a2fc7ec80aea43768c11c50922a665a08b3885c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a2fc7ec80aea43768c11c50922a665a08b3885c0/doctest.py
name = os.path.split(path)[-1]
name = os.path.basename(path)
def DocFileTest(path, module_relative=True, package=None, globs=None, **options): if globs is None: globs = {} if package and not module_relative: raise ValueError("Package may only be specified for module-" "relative paths.") # Relativize the path. if module_relative: package = _normalize_module(package) path = _mod...
a2fc7ec80aea43768c11c50922a665a08b3885c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a2fc7ec80aea43768c11c50922a665a08b3885c0/doctest.py
The name of a set-up function. This is called before running the
A set-up function. This is called before running the
def DocFileSuite(*paths, **kw): """A unittest suite for one or more doctest files. The path to each doctest file is given as a string; the interpretation of that string depends on the keyword argument "module_relative". A number of options may be provided as keyword arguments: module_relative If "module_relative" is...
a2fc7ec80aea43768c11c50922a665a08b3885c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a2fc7ec80aea43768c11c50922a665a08b3885c0/doctest.py
The name of a tear-down function. This is called after running the
A tear-down function. This is called after running the
def DocFileSuite(*paths, **kw): """A unittest suite for one or more doctest files. The path to each doctest file is given as a string; the interpretation of that string depends on the keyword argument "module_relative". A number of options may be provided as keyword arguments: module_relative If "module_relative" is...
a2fc7ec80aea43768c11c50922a665a08b3885c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a2fc7ec80aea43768c11c50922a665a08b3885c0/doctest.py
if ok:
if fss:
def interact(options, title): """Let the user interact with the dialog""" try: # Try to go to the "correct" dir for GetDirectory os.chdir(options['dir'].as_pathname()) except os.error: pass d = GetNewDialog(DIALOG_ID, -1) htext = d.GetDialogItemAsControl(TITLE_ITEM) SetDialogItemText(htext, title) path_ctl = d.GetDialo...
2373ff4e4ffbcd35112e13528b162ee80e4786cc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2373ff4e4ffbcd35112e13528b162ee80e4786cc/EditPythonPrefs.py
modulesbyfile[getabsfile(module)] = module.__name__
modulesbyfile[ os.path.realpath( getabsfile(module))] = module.__name__
def getmodule(object): """Return the module an object was defined in, or None if not found.""" if ismodule(object): return object if isclass(object): return sys.modules.get(object.__module__) try: file = getabsfile(object) except TypeError: return None if file in modulesbyfile: return sys.modules.get(modulesbyfile[file...
b3de2e13baaac7573720c62276984cba13c01c75 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b3de2e13baaac7573720c62276984cba13c01c75/inspect.py
chunks.append(size)
chunks.append(data)
def read(self, size): """Read 'size' bytes from remote.""" # sslobj.read() sometimes returns < size bytes chunks = [] read = 0 while read < size: data = self.sslobj.read(size-read) read += len(data) chunks.append(size)
c1e32b651896e24877e0e601fd7eb6215dbb916d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c1e32b651896e24877e0e601fd7eb6215dbb916d/imaplib.py
suffix_map = db.encodings_map
suffix_map = db.suffix_map
def init(files=None): global guess_extension, guess_type global suffix_map, types_map, encodings_map global inited inited = 1 db = MimeTypes() if files is None: files = knownfiles for file in files: if os.path.isfile(file): db.readfp(open(file)) encodings_map = db.encodings_map suffix_map = db.encodings_map types_map =...
c81a06998f1de7e5f97a7c9599310c34214cec8f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c81a06998f1de7e5f97a7c9599310c34214cec8f/mimetypes.py
isbigendian = struct.pack('=i', 1)[0] == chr(0)
def any_err(func, *args): try: apply(func, args) except (struct.error, OverflowError, TypeError): pass else: raise TestFailed, "%s%s did not raise error" % ( func.__name__, args)
17e17d440644f780e793466b47ca354459a8d68a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17e17d440644f780e793466b47ca354459a8d68a/test_struct.py
('='+fmt, isbigendian and big or lil)]:
('='+fmt, ISBIGENDIAN and big or lil)]:
def any_err(func, *args): try: apply(func, args) except (struct.error, OverflowError, TypeError): pass else: raise TestFailed, "%s%s did not raise error" % ( func.__name__, args)
17e17d440644f780e793466b47ca354459a8d68a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17e17d440644f780e793466b47ca354459a8d68a/test_struct.py
def any_err(func, *args): try: apply(func, args) except (struct.error, OverflowError, TypeError): pass else: raise TestFailed, "%s%s did not raise error" % ( func.__name__, args)
17e17d440644f780e793466b47ca354459a8d68a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17e17d440644f780e793466b47ca354459a8d68a/test_struct.py
def string_reverse(s): chars = list(s) chars.reverse() return "".join(chars) def bigendian_to_native(value): if isbigendian: return value else: return string_reverse(value)
def any_err(func, *args): try: apply(func, args) except (struct.error, OverflowError, TypeError): pass else: raise TestFailed, "%s%s did not raise error" % ( func.__name__, args)
17e17d440644f780e793466b47ca354459a8d68a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17e17d440644f780e793466b47ca354459a8d68a/test_struct.py
MIN_Q, MAX_Q = 0, 2L**64 - 1 MIN_q, MAX_q = -(2L**63), 2L**63 - 1
def test_native_qQ(): bytes = struct.calcsize('q') # The expected values here are in big-endian format, primarily because # I'm on a little-endian machine and so this is the clearest way (for # me) to force the code to get exercised. for format, input, expected in ( ('q', -1, '\xff' * bytes), ('q', 0, '\x00' * bytes), ...
17e17d440644f780e793466b47ca354459a8d68a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17e17d440644f780e793466b47ca354459a8d68a/test_struct.py
def test_one_qQ(x, pack=struct.pack, unpack=struct.unpack, unhexlify=binascii.unhexlify): if verbose: print "trying std q/Q on", x, "==", hex(x) if MIN_q <= x <= MAX_q: expected = long(x) if x < 0: expected += 1L << 64 assert expected > 0 expected = hex(expected)[2:-1] if len(expected) & 1: expected = "0" + expected...
class IntTester: BUGGY_RANGE_CHECK = "bBhHIL" def __init__(self, formatpair, bytesize): assert len(formatpair) == 2 self.formatpair = formatpair for direction in "<>!=": for code in formatpair: format = direction + code verify(struct.calcsize(format) == bytesize) self.bytesize = bytesize self.bitsize = bytesize * 8...
def test_one_qQ(x, pack=struct.pack, unpack=struct.unpack, unhexlify=binascii.unhexlify): if verbose: print "trying std q/Q on", x, "==", hex(x) # Try 'q'. if MIN_q <= x <= MAX_q: # Try '>q'. expected = long(x) if x < 0: expected += 1L << 64 assert expected > 0 expected = hex(expected)[2:-1] # chop "0x" and trailing '...
17e17d440644f780e793466b47ca354459a8d68a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17e17d440644f780e793466b47ca354459a8d68a/test_struct.py
self.__testMethodName = methodName
self._testMethodName = methodName
def __init__(self, methodName='runTest'): """Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name. """ try: self.__testMethodName = methodName testMethod = getattr(self, methodName) self.__testMethodDoc = te...
81cdb4ebe1e8062168f44f12c80e0426344add31 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/81cdb4ebe1e8062168f44f12c80e0426344add31/unittest.py
self.__testMethodDoc = testMethod.__doc__
self._testMethodDoc = testMethod.__doc__
def __init__(self, methodName='runTest'): """Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name. """ try: self.__testMethodName = methodName testMethod = getattr(self, methodName) self.__testMethodDoc = te...
81cdb4ebe1e8062168f44f12c80e0426344add31 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/81cdb4ebe1e8062168f44f12c80e0426344add31/unittest.py
doc = self.__testMethodDoc
doc = self._testMethodDoc
def shortDescription(self): """Returns a one-line description of the test, or None if no description has been provided.
81cdb4ebe1e8062168f44f12c80e0426344add31 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/81cdb4ebe1e8062168f44f12c80e0426344add31/unittest.py
return "%s.%s" % (_strclass(self.__class__), self.__testMethodName)
return "%s.%s" % (_strclass(self.__class__), self._testMethodName)
def id(self): return "%s.%s" % (_strclass(self.__class__), self.__testMethodName)
81cdb4ebe1e8062168f44f12c80e0426344add31 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/81cdb4ebe1e8062168f44f12c80e0426344add31/unittest.py
return "%s (%s)" % (self.__testMethodName, _strclass(self.__class__))
return "%s (%s)" % (self._testMethodName, _strclass(self.__class__))
def __str__(self): return "%s (%s)" % (self.__testMethodName, _strclass(self.__class__))
81cdb4ebe1e8062168f44f12c80e0426344add31 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/81cdb4ebe1e8062168f44f12c80e0426344add31/unittest.py
(_strclass(self.__class__), self.__testMethodName)
(_strclass(self.__class__), self._testMethodName)
def __repr__(self): return "<%s testMethod=%s>" % \ (_strclass(self.__class__), self.__testMethodName)
81cdb4ebe1e8062168f44f12c80e0426344add31 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/81cdb4ebe1e8062168f44f12c80e0426344add31/unittest.py
testMethod = getattr(self, self.__testMethodName)
testMethod = getattr(self, self._testMethodName)
def run(self, result=None): if result is None: result = self.defaultTestResult() result.startTest(self) testMethod = getattr(self, self.__testMethodName) try: try: self.setUp() except KeyboardInterrupt: raise except: result.addError(self, self.__exc_info()) return
81cdb4ebe1e8062168f44f12c80e0426344add31 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/81cdb4ebe1e8062168f44f12c80e0426344add31/unittest.py
result.addError(self, self.__exc_info())
result.addError(self, self._exc_info())
def run(self, result=None): if result is None: result = self.defaultTestResult() result.startTest(self) testMethod = getattr(self, self.__testMethodName) try: try: self.setUp() except KeyboardInterrupt: raise except: result.addError(self, self.__exc_info()) return
81cdb4ebe1e8062168f44f12c80e0426344add31 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/81cdb4ebe1e8062168f44f12c80e0426344add31/unittest.py
result.addFailure(self, self.__exc_info())
result.addFailure(self, self._exc_info())
def run(self, result=None): if result is None: result = self.defaultTestResult() result.startTest(self) testMethod = getattr(self, self.__testMethodName) try: try: self.setUp() except KeyboardInterrupt: raise except: result.addError(self, self.__exc_info()) return
81cdb4ebe1e8062168f44f12c80e0426344add31 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/81cdb4ebe1e8062168f44f12c80e0426344add31/unittest.py
result.addError(self, self.__exc_info())
result.addError(self, self._exc_info())
def run(self, result=None): if result is None: result = self.defaultTestResult() result.startTest(self) testMethod = getattr(self, self.__testMethodName) try: try: self.setUp() except KeyboardInterrupt: raise except: result.addError(self, self.__exc_info()) return
81cdb4ebe1e8062168f44f12c80e0426344add31 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/81cdb4ebe1e8062168f44f12c80e0426344add31/unittest.py
result.addError(self, self.__exc_info())
result.addError(self, self._exc_info())
def run(self, result=None): if result is None: result = self.defaultTestResult() result.startTest(self) testMethod = getattr(self, self.__testMethodName) try: try: self.setUp() except KeyboardInterrupt: raise except: result.addError(self, self.__exc_info()) return
81cdb4ebe1e8062168f44f12c80e0426344add31 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/81cdb4ebe1e8062168f44f12c80e0426344add31/unittest.py