From d6eefa0a7b090bd42511ac71dec92477bf3b7a81 Mon Sep 17 00:00:00 2001 From: Andrew Miller Date: Thu, 28 Jan 2016 09:39:19 +0000 Subject: [PATCH] cleanup and fix tests --- duedil/resources/__init__.py | 4 ---- duedil/resources/pro/company/accounts/__init__.py | 4 ---- tests/test_client.py | 7 ++++--- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/duedil/resources/__init__.py b/duedil/resources/__init__.py index 4fd1200..02f533c 100644 --- a/duedil/resources/__init__.py +++ b/duedil/resources/__init__.py @@ -26,10 +26,6 @@ from ..api import LiteClient, ProClient # , InternationalClient -class ReadOnlyException(Exception): - pass - - class Resource(Mapping): attribute_names = None locale = 'uk' diff --git a/duedil/resources/pro/company/accounts/__init__.py b/duedil/resources/pro/company/accounts/__init__.py index 2f069de..a83e895 100644 --- a/duedil/resources/pro/company/accounts/__init__.py +++ b/duedil/resources/pro/company/accounts/__init__.py @@ -6,10 +6,6 @@ import sys -class UnknownAccountTypeException(Exception): - pass - - class Account(RelatedResourceMixin, ProResource): 'Abstraction of Accounts resource in duedil v3 pro api' attribute_names = [ diff --git a/tests/test_client.py b/tests/test_client.py index ddd74ce..147bd9c 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -25,7 +25,7 @@ import requests_mock from requests.exceptions import HTTPError -from duedil.api import LiteClient, ProClient, InternationalClient, Client +from duedil.api import LiteClient, ProClient, InternationalClient, Client, APIMonthlyLimitException from duedil.resources.lite import Company as LiteCompany from duedil.search.pro import CompanySearchResult as ProCompanySearchResult, DirectorSearchResult from duedil.search.lite import CompanySearchResult as LiteCompanySearchResult @@ -131,8 +131,9 @@ def test_throttling_quota(self, m): {'status_code': 200, 'json': {'name': 'Duedil', 'id': '12345'}}, ]) data = {'name': 'Duedil', 'id': '12345'} - response = client.get('12345') - self.assertEqual(response, {'name': 'Duedil', 'id': '12345'}) + with self.assertRaises(APIMonthlyLimitException): + response = client.get('12345') + self.assertIsNone(response) def test_incorrect_query_params(self):