Files
pytest2/testing/plugins_integration/bdd_wallet.py
Sorin Sbarnea b031a7cecf Smoke tests for assorted plugins (#7721)
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: Kyle Altendorf <sda@fstab.net>
2020-09-19 15:56:52 -03:00

40 lines
618 B
Python

from pytest_bdd import given
from pytest_bdd import scenario
from pytest_bdd import then
from pytest_bdd import when
import pytest
@scenario("bdd_wallet.feature", "Buy fruits")
def test_publish():
pass
@pytest.fixture
def wallet():
class Wallet:
amount = 0
return Wallet()
@given("A wallet with 50")
def fill_wallet(wallet):
wallet.amount = 50
@when("I buy some apples for 1")
def buy_apples(wallet):
wallet.amount -= 1
@when("I buy some bananas for 2")
def buy_bananas(wallet):
wallet.amount -= 2
@then("I have 47 left")
def check(wallet):
assert wallet.amount == 47