Exemplo n.º 1
0
 def cards(self):
     """
     Returns list of *Card* namedtuples associated with logged in user
     """
     if not self._dashboard_content:
         raise ClipperCardError('Must login first')
     return parser.parse_cards(self._dashboard_content)
Exemplo n.º 2
0
 def cards(self):
     """
     Returns list of *Card* namedtuples associated with logged in user
     """
     if not self._dashboard_content:
         raise ClipperCardError('Must login first')
     return parser.parse_cards(self._dashboard_content)
Exemplo n.º 3
0
 def cards(self):
     """
     Returns list of *Card* namedtuples associated with logged in user
     """
     if not self._account_resp_soup:
         raise ClipperCardError("Must login first")
     return parser.parse_cards(self._account_resp_soup)
 def test_cards(self):
     card1, card2 = parser.parse_cards(self.test_content)
     print card1, card2
     self.assertEqual('111', card1.serial_number)
     self.assertEqual('Golden Gate Bridge Limited Edition', card1.nickname)
     self.assertEqual('ADULT', card1.type)
     self.assertEqual('Active', card1.status)
     self.assertEqual('222', card2.serial_number)
     self.assertEqual('Bay Bridge Limited Edition', card2.nickname)
     self.assertEqual('YOUTH', card2.type)
     self.assertEqual('Active', card2.status)
     bart_hvd, cash1 = card1.products
     self.assertEqual('BART HVD 60/64', bart_hvd.name)
     self.assertEqual('$47.55', bart_hvd.value)
     self.assertEqual('Cash value', cash1.name)
     self.assertEqual('$51.40', cash1.value)
     cash2 = card2.products[0]
     self.assertEqual('Cash value', cash2.name)
     self.assertEqual('$2.35', cash2.value)
Exemplo n.º 5
0
 def test_cards(self):
     card1, card2 = parser.parse_cards(self.test_content)
     print card1, card2
     self.assertEqual('111', card1.serial_number)
     self.assertEqual('Golden Gate Bridge Limited Edition', card1.nickname)
     self.assertEqual('ADULT', card1.type)
     self.assertEqual('Active', card1.status)
     self.assertEqual('222', card2.serial_number)
     self.assertEqual('Bay Bridge Limited Edition', card2.nickname)
     self.assertEqual('YOUTH', card2.type)
     self.assertEqual('Active', card2.status)
     bart_hvd, cash1 = card1.products
     self.assertEqual('BART HVD 60/64', bart_hvd.name)
     self.assertEqual('$47.55', bart_hvd.value)
     self.assertEqual('Cash value', cash1.name)
     self.assertEqual('$51.40', cash1.value)
     cash2 = card2.products[0]
     self.assertEqual('Cash value', cash2.name)
     self.assertEqual('$2.35', cash2.value)
Exemplo n.º 6
0
 def test_cards(self):
     parsed_cards = parser.parse_cards(self.account_page_soup)
     self.assertEqual(9, len(parsed_cards))