コード例 #1
0
 def test_attempted_three_point_field_goals_when_cells_exist(self):
     cell = MagicMock(text_content=MagicMock(return_value="some attempted three point field goals"))
     self.html.xpath = MagicMock(return_value=[cell])
     self.assertEqual(
         BasicBoxScoreRow(html=self.html).attempted_three_point_field_goals,
         "some attempted three point field goals",
     )
     self.html.xpath.assert_called_once_with('td[@data-stat="fg3a"]')
コード例 #2
0
 def test_attempted_free_throws_is_empty_string_when_cells_exist(self):
     self.html.xpath = MagicMock(return_value=[])
     self.assertEqual(BasicBoxScoreRow(html=self.html).attempted_free_throws, '')
     self.html.xpath.assert_called_once_with('td[@data-stat="fta"]')
コード例 #3
0
 def test_attempted_free_throws_when_cells_exist(self):
     cell = MagicMock(text_content=MagicMock(return_value="some attempted free throws"))
     self.html.xpath = MagicMock(return_value=[cell])
     self.assertEqual(BasicBoxScoreRow(html=self.html).attempted_free_throws, "some attempted free throws")
     self.html.xpath.assert_called_once_with('td[@data-stat="fta"]')
コード例 #4
0
 def test_made_field_goals_when_cells_exist(self):
     cell = MagicMock(text_content=MagicMock(return_value="some made field goals"))
     self.html.xpath = MagicMock(return_value=[cell])
     self.assertEqual(BasicBoxScoreRow(html=self.html).made_field_goals, "some made field goals")
     self.html.xpath.assert_called_once_with('td[@data-stat="fg"]')
コード例 #5
0
 def test_made_three_point_field_goals_is_empty_string_when_cells_exist(self):
     self.html.xpath = MagicMock(return_value=[])
     self.assertEqual(BasicBoxScoreRow(html=self.html).made_three_point_field_goals, '')
     self.html.xpath.assert_called_once_with('td[@data-stat="fg3"]')
コード例 #6
0
 def test_minutes_played_when_cells_exist(self):
     cell = MagicMock(text_content=MagicMock(return_value="some minutes played"))
     self.html.xpath = MagicMock(return_value=[cell])
     self.assertEqual(BasicBoxScoreRow(html=self.html).minutes_played, "some minutes played")
     self.html.xpath.assert_called_once_with('td[@data-stat="mp"]')
コード例 #7
0
 def test_minutes_played_is_empty_string_when_cells_do_not_exist(self):
     self.html.xpath = MagicMock(return_value=[])
     self.assertEqual(BasicBoxScoreRow(html=self.html).minutes_played, '')
     self.html.xpath.assert_called_once_with('td[@data-stat="mp"]')
コード例 #8
0
 def test_points(self):
     cell = MagicMock(text_content=MagicMock(return_value="some points"))
     self.html.xpath = MagicMock(return_value=[cell])
     self.assertEqual(BasicBoxScoreRow(html=self.html).points, "some points")
     self.html.xpath.assert_called_once_with('td[@data-stat="pts"]')
コード例 #9
0
 def test_personal_fouls_is_empty_string_when_cells_exist(self):
     self.html.xpath = MagicMock(return_value=[])
     self.assertEqual(BasicBoxScoreRow(html=self.html).personal_fouls, '')
     self.html.xpath.assert_called_once_with('td[@data-stat="pf"]')
コード例 #10
0
 def test_personal_fouls_when_cells_exist(self):
     cell = MagicMock(text_content=MagicMock(return_value="some personal fouls"))
     self.html.xpath = MagicMock(return_value=[cell])
     self.assertEqual(BasicBoxScoreRow(html=self.html).personal_fouls, "some personal fouls")
     self.html.xpath.assert_called_once_with('td[@data-stat="pf"]')
コード例 #11
0
 def test_defensive_rebounds_is_empty_string_when_cells_exist(self):
     self.html.xpath = MagicMock(return_value=[])
     self.assertEqual(BasicBoxScoreRow(html=self.html).defensive_rebounds, '')
     self.html.xpath.assert_called_once_with('td[@data-stat="drb"]')
コード例 #12
0
 def test_defensive_rebounds_when_cells_exist(self):
     cell = MagicMock(text_content=MagicMock(return_value="some defensive rebounds"))
     self.html.xpath = MagicMock(return_value=[cell])
     self.assertEqual(BasicBoxScoreRow(html=self.html).defensive_rebounds, "some defensive rebounds")
     self.html.xpath.assert_called_once_with('td[@data-stat="drb"]')