def test_launch_providers_type(self):
     resp_json = launchlibrary.launch_providers(type=1).json()
     agencies = resp_json['agencies']
     agency = agencies[0]
     self.assertIsInstance(agencies, list)
     self.assertIsInstance(agency, dict)
     self.assertEqual(agency['type'], 1)
 def test_launch_providers_country_code(self):
     resp_json = launchlibrary.launch_providers(countryCode='USA').json()
     agencies = resp_json['agencies']
     agency = agencies[0]
     self.assertIsInstance(agencies, list)
     self.assertIsInstance(agency, dict)
     self.assertEqual(agency['countryCode'], 'USA')
 def test_launch_providers_abbrev(self):
     resp_json = launchlibrary.launch_providers(abbrev='NASA').json()
     agencies = resp_json['agencies']
     nasa = agencies[0]
     self.assertEqual(resp_json['count'], 1)
     self.assertIsInstance(agencies, list)
     self.assertIsInstance(nasa, dict)
     self.assertEqual(nasa['abbrev'], 'NASA')
 def test_launch_providers_id(self):
     resp_json = launchlibrary.launch_providers(id=44).json()
     agencies = resp_json['agencies']
     nasa = agencies[0]
     self.assertEqual(resp_json['count'], 1)
     self.assertIsInstance(agencies, list)
     self.assertIsInstance(nasa, dict)
     self.assertEqual(nasa['id'], 44)
 def test_launch_providers_name(self):
     resp_json = launchlibrary.launch_providers(
         name='National Aeronautics and Space Administration').json()
     agencies = resp_json['agencies']
     nasa = agencies[0]
     self.assertEqual(resp_json['count'], 1)
     self.assertIsInstance(agencies, list)
     self.assertIsInstance(nasa, dict)
     self.assertEqual(nasa['name'],
                      'National Aeronautics and Space Administration')
 def test_launch_providers_json(self):
     resp_json = launchlibrary.launch_providers().json()
     self.assertIsInstance(resp_json, dict)
     self.assertIn('agencies', resp_json)
     self.assertIsInstance(resp_json['agencies'], list)
     self.assertIn('total', resp_json)
     self.assertIsInstance(resp_json['total'], int)
     self.assertIn('count', resp_json)
     self.assertIsInstance(resp_json['count'], int)
     self.assertIn('offset', resp_json)
     self.assertIsInstance(resp_json['offset'], int)
 def test_launch_providers_changed(self):
     resp = launchlibrary.launch_providers(changed='2012-09-05 00:00:00')
     resp_json = resp.json()
     agencies = resp_json['agencies']
     agency = agencies[0]
     self.assertIsInstance(agencies, list)
     self.assertIsInstance(agency, dict)
     # changed will show agencies that have changed since the
     # date provided so we check that resulting date is
     # greater or equal than the date provided
     self.assertGreaterEqual(
         datetime_from_datestring(agency['changed']),
         datetime_from_datestring('2012-09-05 00:00:00'))
 def test_launch_providers(self):
     resp = launchlibrary.launch_providers()
     self.assertEqual(200, resp.status_code)
     self.assertIsInstance(resp, Response)