Exemplo n.º 1
0
 def test_status(self):
     ep_id = "519"
     ep = BangumiEpisode.from_html(ep_id, self._ep_html)
     with self.assertRaises(ValueError):
         ep.status = 'invalid'
     self.assertEqual('air', ep.status)
     ep.status = 'na'
     self.assertEqual('na', ep.status)
     ep.status = 'today'
     self.assertEqual('today', ep.status)
Exemplo n.º 2
0
 def test_status(self):
     ep_id = "519"
     ep = BangumiEpisode.from_html(ep_id, self._ep_html)
     with self.assertRaises(ValueError):
         ep.status = 'invalid'
     self.assertEqual('air', ep.status)
     ep.status = 'na'
     self.assertEqual('na', ep.status)
     ep.status = 'today'
     self.assertEqual('today', ep.status)
Exemplo n.º 3
0
 def test_from_html_with_ep(self):
     ep_id = "519"
     ep = BangumiEpisode.from_html(ep_id, self._ep_html)
     ep_coll = BangumiEpisodeCollection.from_html_with_ep(ep,
                                                          self._ep_html)
     self.assertEqual(self._c_statuses[0], ep_coll.c_status)
Exemplo n.º 4
0
 def test_subject(self):
     ep_id = "519"
     ep = BangumiEpisode.from_html(ep_id, self._ep_html)
     self.assertIsNone(ep.subject)
     with self.assertRaises(TypeError):
         ep.subject = ep
Exemplo n.º 5
0
 def test_fixed_attribute_exception(self):
     ep_id = "519"
     ep = BangumiEpisode.from_html(ep_id, self._ep_html)
     for key in ['id_', 'ep_num', 'ep_type', 'title', 'ch_title']:
         with self.assertRaises(AttributeError):
             setattr(ep, key, 's')
Exemplo n.º 6
0
 def test_from_html(self):
     ep_id = "519"
     ep = BangumiEpisode.from_html(ep_id, self._ep_html)
     self.assertEqual(self._ep_ids[0], ep.id_)
     self.assertEqual(self._ep_nums[0], ep.ep_num)
     self.assertEqual(self._ep_types[0], ep.ep_type)
Exemplo n.º 7
0
 def test_subject(self):
     ep_id = "519"
     ep = BangumiEpisode.from_html(ep_id, self._ep_html)
     self.assertIsNone(ep.subject)
     with self.assertRaises(TypeError):
         ep.subject = ep
Exemplo n.º 8
0
 def test_fixed_attribute_exception(self):
     ep_id = "519"
     ep = BangumiEpisode.from_html(ep_id, self._ep_html)
     for key in ['id_', 'ep_num', 'ep_type', 'title', 'ch_title']:
         with self.assertRaises(AttributeError):
             setattr(ep, key, 's')
Exemplo n.º 9
0
 def test_from_html(self):
     ep_id = "519"
     ep = BangumiEpisode.from_html(ep_id, self._ep_html)
     self.assertEqual(self._ep_ids[0], ep.id_)
     self.assertEqual(self._ep_nums[0], ep.ep_num)
     self.assertEqual(self._ep_types[0], ep.ep_type)