

@silence_is_golden
def test_parse_products(self, *args):
    prod_soup = BeautifulSoup(PRODUCT_CONTENT)
    products = self.card._parse_products(prod_soup)
    expect_date = datetime(year=1984, month=12, day=2)
    self.assertEquals(5, len(products))
    self.assertEquals(products[0], {
        'name': 'Foo',
        'remaining_rides': 100,
        'expiration_date': expect_date,
    })
    self.assertEquals(empty_products[1], {
        'name': '',
        'remaining_rides': None,
        'expiration_date': None,
    })
    self.assertEquals(products[2], {
        'name': 'Bar',
        'remaining_rides': 100,
        'expiration_date': None,
    })
    self.assertEquals(products[3], {
        'name': 'Baz',
        'remaining_rides': None,
        'expiration_date': expect_date,
    })
    self.assertEquals(products[4], {
        'name': 'Xyz',
        'remaining_rides': None,
        'expiration_date': None,
    })
    empty_products = self.card._parse_products(self.empty_soup)
    self.assertEquals(0, len(empty_products))

dataset/ETHPy150Open shaunduncan/breezeminder/breezeminder/tests/models/test_card.py BreezeCardTestCase.test_parse_products/VarMisuse@96/134 `products`->`empty_products`