Beispiel #1
0
class ClientTestCase(unittest.TestCase):
    """Test case for the nbapipy methods."""

    def setUp(self):
        self.client = Client(user_agent='*****@*****.**',
                             access_token='28b20ac0-57f5-41ff-a1c3-12f037ec251e')

    def test_request(self):
        """Test a simple request."""
        user = '******'
        response = self.client.make_request(user)
        self.assertIn('first_name', response)
        self.assertEqual(response['first_name'], 'Raul')
        self.assertEquals(response['last_name'], 'Gil')

    def test_events(self):
        events = '/events'
        response = self.client.make_request(events, data={'sport': 'nba', 'date': '20130131'})
        for event in response['event']:
            self.assertEquals(event['sport'], 'NBA')
            self.assertNotEquals(event['sport'], 'MLB')
Beispiel #2
0
 def setUp(self):
     self.client = Client(user_agent='*****@*****.**',
                          access_token='28b20ac0-57f5-41ff-a1c3-12f037ec251e')