Exemplo n.º 1
0
 def test_square_2(self):
     self.addDetail('arbitrary-color-name', text_content('blue'))
     self.addDetail(
         'log-file',
         Content(UTF8_TEXT, lambda: open('log.txt', 'r').readlines()))
     result = silly.square(7)
     self.assertThat(result, Equals(49))
Exemplo n.º 2
0
    def test_square(self):
        def cleanup():
            print "addCleanup"

        self.addCleanup(cleanup)
        result = silly.square(7)
        self.assertEqual(result,
                         49)  # it is implmented using assertThat anyway
Exemplo n.º 3
0
	def test_square_bad_input_2(self):
		with ExpectedException(TypeError, "can't multiply.*"):
			silly.square('organge')
Exemplo n.º 4
0
	def test_square_2(self):
		self.addDetail('arbitrary-color-name', text_content('blue'))
		self.addDetail('log-file', Content(UTF8_TEXT, lambda: open('log.txt', 'r').readlines()))
		result = silly.square(7)
		self.assertThat(result, Equals(49))
Exemplo n.º 5
0
	def test_square(self):
		def cleanup():
			print "addCleanup"
		self.addCleanup(cleanup)
		result = silly.square(7)
		self.assertEqual(result, 49) # it is implmented using assertThat anyway
Exemplo n.º 6
0
 def test_square_bad_input_2(self):
     with ExpectedException(TypeError, "can't multiply.*"):
         silly.square('organge')