Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.064 X-Spam-Evidence: '*H*': 0.87; '*S*': 0.00; 'repeated': 0.07; '(the': 0.15; 'file,': 0.15; "'b'": 0.16; 'wrote:': 0.17; 'bytes': 0.17; 'sender:addr:gmail.com': 0.18; 'header:In-Reply-To:1': 0.25; 'values': 0.26; 'i.e.': 0.27; '-0700,': 0.29; 'character': 0.29; "i'm": 0.29; 'checks': 0.30; 'error': 0.30; 'code': 0.31; 'getting': 0.33; 'received:74.125.82': 0.33; 'skip:s 30': 0.33; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'received:192.168.0': 0.35; 'received:74.125': 0.36; 'two': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'header:Received:5': 0.40; 'think': 0.40; 'your': 0.60; 'times': 0.63; 'million': 0.72; 'words).': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:subject:from:to:date:in-reply-to:references :content-type:x-mailer:mime-version:content-transfer-encoding; bh=jylobct08Ktsi/UXXe5RhXJqWTPhWG/2fnFlTK8OWZc=; b=J9H3ypinkU8/MSTQTWIMUtJzOlSX3Q+YCqkoZae8okCc2H68zbKBK6aI1OutynQ5MW cqfZmu/gngGTMcHQtRLE5HFRqUJumoNbBT9HLakzXc8VycejXxMTe8gc4v47clovV7rG 4wp0MyMag7rSNE361TFnIHt9EQoCBWRrlZmQPh2JKBC/Oz80Pld82vKKNXTGCeLLyucI 7+mR7pJ9JziBGaZi5QRowIVTwa8cTQYw9EbAqo1Cp26ljrWUO9FzI7GkD+zwqssbwEaj nMEvxS5+ZkqNOc2Y/kcJGY1p57tHpzR0yhvnmPABK/XFYJbOwBMkgNg8gDvS1kFttuID fvLw== Sender: Robert Day Subject: Re: Unittest - testing for filenames and filesize From: Rob Day To: python-list@python.org Date: Sun, 26 Aug 2012 18:51:54 +0100 In-Reply-To: References: <6b0299df-bc24-406b-8d69-489e990d8e4f@googlegroups.com> <8447c547-8472-48c6-ad78-87989c1ce288@googlegroups.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.4.3 (3.4.3-2.fc17) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 12 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1346003519 news.xs4all.nl 6901 [2001:888:2000:d::a6]:50802 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:27938 On Sun, 2012-08-26 at 10:36 -0700, Tigerstyle wrote: > self.assertEqual(statinfo.st_size, filesize) > > I'm still getting AssertionError and the error says: 1000000 !=b' > > filesize is the character 'b' repeated one million times (the contents of the file, in other words). statinfo.st_size is the number of bytes in the file, i.e. 1,000,000. So when your assertEqual code checks if those two values are equal, what do you think happens?