Upload
rafael-caricio
View
1.161
Download
0
Embed Size (px)
Citation preview
EMOCIONANTE3
10 milhões de brasileiros por dia
0
10.000.000
20.000.000
30.000.000
40.000.000
acessos
def test_sum_returns_42(): result = add_two_numbers(41, 1) assert result assert int(result) assert result == 42
Vamos a um exemplo...
def test_sum_returns_result(): result = add_two_numbers(41, 1) assert result def test_sum_returns_a_number(): result = add_two_numbers(41, 1) assert int(result) def test_sum_returns_42(): result = add_two_numbers(41, 1) assert result == 42
Uma forma mais organizada...
class SumContext(Vows.Context): def topic(self): return add_two_numbers(41, 1) def we_get_a_result(self, topic): expect(topic).Not.to_be_null() def we_get_a_number(self, topic): expect(topic).to_be_numeric() def we_get_42(self, topic): expect(topic).to_equal(42)
Como seria com o pyVows
class SumContext(Vows.Context): def topic(self): return add_two_numbers(41, 1) def we_get_a_result(self, topic): expect(topic).Not.to_be_null() def we_get_a_number(self, topic): expect(topic).to_be_numeric() def we_get_42(self, topic): expect(topic).to_equal(42)
Como seria com o pyVows
class SumContext(Vows.Context): def topic(self): return add_two_numbers(41, 1) def we_get_a_result(self, topic): expect(topic).Not.to_be_null() def we_get_a_number(self, topic): expect(topic).to_be_numeric() def we_get_42(self, topic): expect(topic).to_equal(42)
Como seria com o pyVows
https://github.com/heynemann/pyvows/
Como contribuir?
•Pull request