Browse files

Removing the last vestiges of the old project layout. Updating docs s…

…lightly with grammar and accuracy fixes.
  • Loading branch information...
1 parent b59358d commit 1d70c25965ff5dc8bdcdc99a407cd8d29d1c84b0 @gtaylor gtaylor committed with Aug 5, 2010
Showing with 27 additions and 29 deletions.
  1. +8 −25 README.md
  2. +2 −2 paypal/settings.py
  3. +17 −2 tests/interface_factory.py
View
33 README.md
@@ -6,34 +6,17 @@ QUICKSTART
----------
To run test suite:
+
+ python tests/runner.py
- python paypal/test.py
-
-The meat is in `paypal.sdk.interface`. The docs are in the docstrings and tests.
-
-- Create a paypal.sdk.interface.Interface object
-- pass it configuration args
-- that interface is how you access paypal.
-
-Pat Collins' original was useful, but had the config info hardcoded into a
-Settings object.
-
-So I refactored hid code into more of an OOP concept.
-
-basically, you create a sdk.Interface() instace with the account details.
-that creates an internal config object of the PayPalConfig() class
-(was settings.py). this could be overriden by making a raw config object and
-explicitly setting it.
-
-all of the original methods were migrated to the the Interface class -- and
-alphabetized -- as methods of that class.
+The meat is in `paypal.interface`. The docs are in the docstrings and tests.
-the end result -- which i was going for -- is that i can now construct an
-interface with the account settings -- and not worry about editing config files
-and having to manually place this library in every project. It's also easier to
-lookup info.
+- Create a paypal.interface.PayPalInterface object
+- Pass it configuration kwargs
+- That interface is how you access PayPal.
--- Jonathan Vanasco ( jonathan@2xlp.com )
+Create a PayPalInterface() instace with the account details passed as kwargs.
+This creates an internal PayPalConfig object.
WHY?
----
View
4 paypal/settings.py
@@ -1,6 +1,6 @@
# coding=utf-8
"""
-This module contains config objects needed by paypal.sdk.interface.PayPalInterface.
+This module contains config objects needed by paypal.interface.PayPalInterface.
Most of this is transparent to the end developer, as the PayPalConfig object
is instantiated by the PayPalInterface object.
"""
@@ -11,7 +11,7 @@ class PayPalConfig(object):
"""
The PayPalConfig object is used to allow the developer to perform API
queries with any number of different accounts or configurations. This
- is done by instantiating paypal.sdk.interface.PayPalInterface, passing config
+ is done by instantiating paypal.interface.PayPalInterface, passing config
directives as keyword args.
"""
# Used to validate correct values for certain config directives.
View
19 tests/interface_factory.py
@@ -1,11 +1,21 @@
+"""
+This module creates PayPalInterface objects for each of the unit test
+modules to use. We create a new one for each unittest module to reduce any
+chance of tainting tests by all of them using the same interface. IE: Values
+getting modified.
+
+See get_interface_obj() below, as well as the README in this tests directory.
+"""
import sys
import os
+# The unit tests import this module, so we'll do the path modification to use
+# this paypal project instead of any potential globally installed ones.
project_root_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if not project_root_dir in sys.path:
sys.path.insert(0, project_root_dir)
-import paypal
+from paypal import PayPalInterface
try:
import api_details
@@ -23,4 +33,9 @@
sys.exit(1)
def get_interface_obj():
- return paypal.PayPalInterface(config=api_details.CONFIG)
+ """
+ Use this function to get a PayPalInterface object with your test API
+ credentials (as specified in api_details.py). Create new interfaces for
+ each unit test module to avoid potential variable pollution.
+ """
+ return PayPalInterface(config=api_details.CONFIG)

0 comments on commit 1d70c25

Please sign in to comment.