def test_get_crunchbase_organization_fails(self, mock_get): mock_json = make_mock_response_json({}) mock_get.return_value = mock_json cb = CrunchBase('123') data = cb.organization('organization') mock_get.assert_called_with( 'https://api.crunchbase.com/v3.1/organizations/organization?' 'user_key=123') self.assertIsNone(data)
def test_get_crunchbase_organization_fails(self, mock_get): mock_json = make_mock_response_json({}) mock_get.return_value = mock_json cb = CrunchBase('123') data = cb.organization('organization') mock_get.assert_called_with( 'https://api.crunchbase.com/v/3/organizations/organization?' 'user_key=123') self.assertIsNone(data)
def test_get_crunchbase_organization_returns_organization(self, mock_get): mock_json = make_mock_response_json({ "data": { "uuid": "df6628127f970b439d3e12f64f504fbb", "type": "Organization", "properties": { "description": "Description", "short_description": "short description" } } }) mock_get.return_value = mock_json cb = CrunchBase('123') organization = cb.organization('organization') mock_get.assert_called_with( 'https://api.crunchbase.com/v3.1/organizations/organization?' 'user_key=123') self.assertEqual(organization.description, "Description")
def test_get_crunchbase_organization_returns_organization(self, mock_get): mock_json = make_mock_response_json({ "data": { "uuid": "df6628127f970b439d3e12f64f504fbb", "type": "Organization", "properties": { "description": "Description", "short_description": "short description" } } }) mock_get.return_value = mock_json cb = CrunchBase('123') organization = cb.organization('organization') mock_get.assert_called_with( 'https://api.crunchbase.com/v/3/organizations/organization?' 'user_key=123') self.assertEqual(organization.description, "Description")