def test_agencytype_id(self):
     resp_json = launchlibrary.agency_type(id=1).json()
     types = resp_json['types']
     government = types[0]
     self.assertEqual(resp_json['count'], 1)
     self.assertIsInstance(types, list)
     self.assertIsInstance(government, dict)
     self.assertEqual(government['id'], 1)
 def test_agencytype_json(self):
     resp_json = launchlibrary.agency_type().json()
     self.assertIsInstance(resp_json, dict)
     self.assertIn('types', resp_json)
     self.assertIsInstance(resp_json['types'], 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_agencytype_changed(self):
     resp = launchlibrary.agency_type(changed='2012-09-05 00:00:00')
     resp_json = resp.json()
     types = resp_json['types']
     t = types[0]
     self.assertIsInstance(types, list)
     self.assertIsInstance(t, 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(t['changed']),
         datetime_from_datestring('2012-09-05 00:00:00'))
 def test_agencytype(self):
     resp = launchlibrary.agency_type()
     self.assertEqual(200, resp.status_code)
     self.assertIsInstance(resp, Response)