Skip to content

Commit

Permalink
Extracted Batch to core level, since it was identical for Street and …
Browse files Browse the repository at this point in the history
…ZIP APIs
  • Loading branch information
MouaYing committed Nov 15, 2016

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
1 parent 3e76ca4 commit 2ed6adb
Showing 12 changed files with 22 additions and 69 deletions.
4 changes: 2 additions & 2 deletions examples/us_street_multiple_addresses_example.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os

from smartystreets_python_sdk import StaticCredentials, exceptions
from smartystreets_python_sdk.us_street import ClientBuilder, Batch, Lookup
from smartystreets_python_sdk import StaticCredentials, exceptions, Batch
from smartystreets_python_sdk.us_street import ClientBuilder, Lookup


def run():
4 changes: 2 additions & 2 deletions examples/us_zipcode_multiple_lookups_example.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os

from smartystreets_python_sdk import StaticCredentials, exceptions
from smartystreets_python_sdk.us_zipcode import ClientBuilder, Batch, Lookup
from smartystreets_python_sdk import StaticCredentials, exceptions, Batch
from smartystreets_python_sdk.us_zipcode import ClientBuilder, Lookup


def run():
1 change: 1 addition & 0 deletions smartystreets_python_sdk/__init__.py
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@
from .signing_sender import SigningSender
from .retry_sender import RetrySender
from .url_prefix_sender import URLPrefixSender
from .batch import Batch
import smartystreets_python_sdk.errors
import smartystreets_python_sdk.us_street
import smartystreets_python_sdk.us_zipcode
File renamed without changes.
10 changes: 5 additions & 5 deletions smartystreets_python_sdk/us_street/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from .lookup import Lookup
from .candidate import Candidate
from .components import Components
from .metadata import Metadata
from .analysis import Analysis
from .batch import Batch
from .candidate import Candidate
from .client import Client
from .client_builder import ClientBuilder
from .components import Components
from .lookup import Lookup
from .metadata import Metadata

4 changes: 2 additions & 2 deletions smartystreets_python_sdk/us_street/client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from smartystreets_python_sdk.us_street import Batch, Candidate
from smartystreets_python_sdk import Request
from smartystreets_python_sdk.us_street import Candidate
from smartystreets_python_sdk import Request, Batch


class Client:
2 changes: 1 addition & 1 deletion smartystreets_python_sdk/us_zipcode/__init__.py
Original file line number Diff line number Diff line change
@@ -2,6 +2,6 @@
from .zipcode import ZipCode
from .result import Result
from .lookup import Lookup
from .batch import Batch
#from .batch import Batch
from .client import Client
from .client_builder import ClientBuilder
48 changes: 0 additions & 48 deletions smartystreets_python_sdk/us_zipcode/batch.py

This file was deleted.

4 changes: 2 additions & 2 deletions smartystreets_python_sdk/us_zipcode/client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from smartystreets_python_sdk.us_zipcode import Batch, Result
from smartystreets_python_sdk import Request
from smartystreets_python_sdk.us_zipcode import Result
from smartystreets_python_sdk import Request, Batch


class Client:
6 changes: 3 additions & 3 deletions test/us_street/batch_test.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import unittest
from smartystreets_python_sdk import us_street
from smartystreets_python_sdk import Batch, us_street


class TestBatch(unittest.TestCase):
def setUp(self):
self.batch = us_street.Batch()
self.batch = Batch()

def test_gets_lookup_by_input_id(self):
lookup = us_street.Lookup()
@@ -42,7 +42,7 @@ def test_adding_a_lookup_when_batch_is_full_returns_false(self):
lookup = us_street.Lookup()
success = None

for i in range(0, us_street.Batch.MAX_BATCH_SIZE):
for i in range(0, Batch.MAX_BATCH_SIZE):
success = self.batch.add(lookup)

self.assertTrue(success)
4 changes: 2 additions & 2 deletions test/us_street/client_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import unittest
from smartystreets_python_sdk import Response, exceptions
from smartystreets_python_sdk.us_street import Client, Lookup, Batch, Candidate
from smartystreets_python_sdk import Response, exceptions, Batch
from smartystreets_python_sdk.us_street import Client, Lookup, Candidate
from test.mocks import RequestCapturingSender, FakeSerializer, FakeDeserializer, MockSender, MockExceptionSender


4 changes: 2 additions & 2 deletions test/us_zipcode/client_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from test.mocks import RequestCapturingSender, FakeSerializer, FakeDeserializer, MockSender
from smartystreets_python_sdk import Response
from smartystreets_python_sdk.us_zipcode import Client, Batch, Lookup, Result
from smartystreets_python_sdk import Response, Batch
from smartystreets_python_sdk.us_zipcode import Client, Lookup, Result


import unittest

0 comments on commit 2ed6adb

Please sign in to comment.