Testing Python by David Sale

Testing Python by David Sale

Author:David Sale
Language: eng
Format: epub, pdf
ISBN: 9781118901243
Publisher: Wiley
Published: 2014-07-02T19:39:08+00:00


Delivering the Finished Article

Add the final step, which will check that the current balance displays as expected. This will take the balance in the step definition and then assert that the balance shown in the browser is the same as that passed into the step. Again, make use of the skeleton generated to give you the starting point.

Then I see a balance of "50"

Add the step definition to perform the check.

...

from nose.tools import assert_equal, assert_in

from lettuce import *

...

@step(u'I see a balance of "([^"]*)"')

def then_i_see_a_balance_of_group1(step, expected_balance):

assert_in ("Balance: {}".format(expected_balance),

world.form_response.text)



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.