예제 #1
0
class TestPlayer(unittest.TestCase):
    def setUp(self,):
        self.player = Player("242.p.8332", "WR")

    def test_player_in_xml(self,):
        expected = b"<player><player_key>242.p.8332</player_key><position>WR</position></player>"
        logging.debug(pretty_xml(self.player.to_xml()))
        self.assertEqual(expected, self.player.to_xml())

    def test_player_in_json(self,):
        expected = {"player_key": "242.p.8332", "position": "WR"}
        logging.debug(pretty_json(self.player.to_json()))
        self.assertEqual(expected, self.player.json)
예제 #2
0
class TestPlayer(unittest.TestCase):
    def setUp(self, ):
        self.player = Player('242.p.8332', 'WR')

    def test_player_in_xml(self, ):
        expected = b'<player><player_key>242.p.8332</player_key><position>WR</position></player>'
        logging.debug(pretty_xml(self.player.to_xml()))
        self.assertEqual(expected, self.player.to_xml())

    def test_player_in_json(self, ):
        expected = {"player_key": "242.p.8332", "position": "WR"}
        logging.debug(pretty_json(self.player.to_json()))
        self.assertEqual(expected, self.player.json)
예제 #3
0
 def setUp(self,):
     self.player = Player('242.p.8332','WR')
예제 #4
0
 def setUp(self,):
     self.player = Player("242.p.8332", "WR")
예제 #5
0
 def setUp(self, ):
     players = [Player('242.p.8332', 'WR'), Player('242.p.8334', 'LR')]
     self.roster = Roster(players, date='2015-01-01')
예제 #6
0
 def setUp(self, ):
     self.player = Player('242.p.8332', 'WR')