Exemple #1
0
def test_is_match_is_true():
    assert YesFilter().is_match(None) is True
def test_name_filter_match():
    b = Beer('bud', '1/2 keg', 'lager', '2.00', '1.00')
    f = NameFilter(YesFilter(), 'bud')
    assert f.is_match(b) is True
Exemple #3
0
def test_size_filter_no_match():
    b = Beer('bud', '1/2 keg', 'lager', '2.00', '1.00')
    f = SizeFilter(YesFilter(), 'pint')
    assert f.is_match(b) is False
def make_test_name_filter(beer_name):
    return NameFilter(YesFilter(), beer_name)
def get_test_filter(quantity_requested):
    return AvailabilityFilter(YesFilter(), quantity_requested)