Re: Unit testing errors (testing the platform module)

2010-04-14 Thread Terry Reedy
On 4/14/2010 11:19 AM, J. Cliff Dyer wrote: On Wed, 2010-04-14 at 15:51 +0100, john maclean wrote: self.assertEqual(platform.__builtins__.__class__, dict, "platform.__class__ supposed to be dict") self.assertEqual(platform.__name__, 'platform' ) The preferred spelling for: platform.__bui

Re: Unit testing errors (testing the platform module)

2010-04-14 Thread J. Cliff Dyer
On Wed, 2010-04-14 at 15:51 +0100, john maclean wrote: > self.assertEqual(platform.__builtins__.__class__, dict, > "platform.__class__ supposed to be dict") > self.assertEqual(platform.__name__, 'platform' ) The preferred spelling for: platform.__builtins__.__class__ would be type(pla

Re: Unit testing errors (testing the platform module)

2010-04-14 Thread john maclean
On 14 April 2010 09:09, Gabriel Genellina wrote: > En Tue, 13 Apr 2010 11:01:19 -0300, John Maclean > escribió: > >> Is there an error in my syntax? Why is my test failing? Line 16. >> >> == >> FAIL: platform.__builtins__.blah >>

Re: Unit testing errors (testing the platform module)

2010-04-14 Thread Gabriel Genellina
En Tue, 13 Apr 2010 11:01:19 -0300, John Maclean escribió: Is there an error in my syntax? Why is my test failing? Line 16. == FAIL: platform.__builtins__.blah

Re: Unit testing errors (testing the platform module)

2010-04-13 Thread J. Cliff Dyer
The problem is that the class of platform.__builtins__ is a dict, not a string containing the text "". Try replacing line 16 with this: self.assertEqual(type(platform.__builtins__), dict) Cheers, Cliff On Tue, 2010-04-13 at 15:01 +0100, John Maclean wrote: > I normally use languages uni

Re: Unit testing errors (testing the platform module)

2010-04-13 Thread MRAB
John Maclean wrote: I normally use languages unit testing framework to get a better understanding of how a language works. Right now I want to grok the platform module; 1 #!/usr/bin/env python 2 '''a pythonic factor''' 3 import unittest 4 import platform 5 6 class TestPyfactorTestCa

Re: Unit testing errors (testing the platform module)

2010-04-13 Thread Martin P. Hellwig
On 04/13/10 15:01, John Maclean wrote: I normally use languages unit testing framework to get a better understanding of how a language works. Right now I want to grok the platform module; 1 #!/usr/bin/env python 2 '''a pythonic factor''' 3 import unittest 4 import platform 5 6

Re: Unit testing errors (testing the platform module)

2010-04-13 Thread Benjamin Kaplan
On Tue, Apr 13, 2010 at 10:01 AM, John Maclean wrote: > I normally use languages unit testing framework to get a better > understanding of how a language works. Right now I want to grok the > platform module; > > > 1 #!/usr/bin/env python > 2 '''a pythonic factor''' > 3 import unittest > 4 i