Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Advertising

Paste Description for Primeiro Python do PacMan

Não gosto de self, gosto de this :)

Primeiro Python do PacMan
Monday, September 15th, 2008 at 7:33:01am MDT 

  1. #!/usr/bin/python
  2.  
  3. import unittest
  4.  
  5. class CalculadoraDeQuadrados:
  6.         def quadradoDe(this,x):
  7.                 return x*x
  8.  
  9. class TesteQuadrado(unittest.TestCase):
  10.         def setUp(this):
  11.                 this.calc = CalculadoraDeQuadrados()
  12.         def tearDown(this):
  13.                 this.calc = None
  14.         def testQuadradoDeZero(this):
  15.                 this.assertEquals(0,this.calc.quadradoDe(0),"0^2 deveria ser 0")
  16.         def testQuadradoDe3DeveriaSer9(this):
  17.                 this.assertEquals(9,this.calc.quadradoDe(3),"3^2 deveria ser 9")
  18.         def testQuadradoDeMenos10DeveriaSer100(this):
  19.                 this.assertEquals(100,this.calc.quadradoDe(-10),"(-10)^2 deveria ser 100")
  20.  
  21. unittest.main()

Paste Details

advertising

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

fantasy-obligation
fantasy-obligation