Unittest - testing for filenames and filesize

Rob Day rkd at rkd.me.uk
Sun Aug 26 13:51:54 EDT 2012


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?




More information about the Python-list mailing list