summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClint Adams <clint@debian.org>2014-12-31 14:23:43 -0500
committerAndrej Shadura <andrewsh@debian.org>2018-04-30 11:06:34 +0200
commite5a019d1a60a00ebf82a9a3802a1d65c1938a1bd (patch)
treeba087b1aad95069f75111bbb985b960da3dd83f3
parent844ba3b0a6bf87cffa7398952a46c6ae6ff170c8 (diff)
parent1dc39ba3b5a6d64a394e77aa25e428874ca1b04f (diff)
Import Debian changes 0.3.2-1
python-ofxhome (0.3.2-1) unstable; urgency=medium * New upstream version.
-rw-r--r--PKG-INFO6
-rw-r--r--README2
-rw-r--r--debian/changelog6
-rw-r--r--debian/control2
-rw-r--r--debian/patches/missing-testfiles.diff76
-rw-r--r--debian/patches/missing-tests.diff162
-rw-r--r--debian/patches/series2
-rw-r--r--ofxhome.egg-info/PKG-INFO6
-rw-r--r--ofxhome.egg-info/SOURCES.txt4
-rw-r--r--ofxhome/__init__.py7
-rw-r--r--ofxhome/tests/__init__.py0
-rw-r--r--ofxhome/tests/test_suite.py109
-rw-r--r--setup.py6
13 files changed, 214 insertions, 174 deletions
diff --git a/PKG-INFO b/PKG-INFO
index e9bca55..daf535c 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
-Metadata-Version: 1.0
+Metadata-Version: 1.1
Name: ofxhome
-Version: 0.3.1
+Version: 0.3.2
Summary: ofxhome.com financial institution lookup REST client
Home-page: https://github.com/captin411/ofxhome
Author: David Bartle
@@ -25,6 +25,7 @@ Description: ofxhome
example
=======
+ ```python
from ofxhome import OFXHome
s = OFXHome.search("USAA")
@@ -36,6 +37,7 @@ Description: ofxhome
bank = OFXHome.lookup(item.id)
print bank.name _ bank.fid _ bank.url _ bank.brokerid # OR
print bank['name'] _ bank['fid'] _ bank['url'] _ bank['brokerid']
+ ```
Keywords: ofx,Open Financial Exchange,bank search,ofxhome,ofxhome.com
Platform: UNKNOWN
diff --git a/README b/README
index 417956d..8305a2b 100644
--- a/README
+++ b/README
@@ -17,6 +17,7 @@ ofxclient - a python API that downloads transactions from banks
example
=======
+```python
from ofxhome import OFXHome
s = OFXHome.search("USAA")
@@ -28,3 +29,4 @@ for item in s:
bank = OFXHome.lookup(item.id)
print bank.name _ bank.fid _ bank.url _ bank.brokerid # OR
print bank['name'] _ bank['fid'] _ bank['url'] _ bank['brokerid']
+```
diff --git a/debian/changelog b/debian/changelog
index ae82b87..251ac9e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+python-ofxhome (0.3.2-1) unstable; urgency=medium
+
+ * New upstream version.
+
+ -- Clint Adams <clint@debian.org> Wed, 31 Dec 2014 14:23:43 -0500
+
python-ofxhome (0.3.1-1) unstable; urgency=low
* Initial release.
diff --git a/debian/control b/debian/control
index f5dc48b..b9e8524 100644
--- a/debian/control
+++ b/debian/control
@@ -6,7 +6,7 @@ Build-Depends: debhelper (>= 9)
, dh-python
, python-all (>= 2.7~)
, python-setuptools
-Standards-Version: 3.9.5
+Standards-Version: 3.9.6
Homepage: https://github.com/captin411/ofxhome
X-Python-Version: >= 2.6
diff --git a/debian/patches/missing-testfiles.diff b/debian/patches/missing-testfiles.diff
new file mode 100644
index 0000000..d94f861
--- /dev/null
+++ b/debian/patches/missing-testfiles.diff
@@ -0,0 +1,76 @@
+--- /dev/null
++++ b/ofxhome/tests/testfiles/badxml_bank.xml
+@@ -0,0 +1,3 @@
++<?xml version="1.0" encoding="utf-8"?>
++<institution id="623">
++<name>
+--- /dev/null
++++ b/ofxhome/tests/testfiles/badxml_search.xml
+@@ -0,0 +1,2 @@
++<?xml version="1.0" encoding="utf-8"?>
++<institutionlist>
+--- /dev/null
++++ b/ofxhome/tests/testfiles/jpmorgan.xml
+@@ -0,0 +1,11 @@
++<?xml version="1.0" encoding="utf-8"?>
++<institution id="435">
++<name>JPMorgan Chase Bank</name>
++<fid>1601</fid>
++<org>Chase Bank</org>
++<url>https://www.oasis.cfree.com/1601.ofxgp</url>
++<ofxfail>0</ofxfail>
++<sslfail>0</sslfail>
++<lastofxvalidation>2014-08-17 22:23:35</lastofxvalidation>
++<lastsslvalidation>2014-08-17 22:23:34</lastsslvalidation>
++</institution>
+--- /dev/null
++++ b/ofxhome/tests/testfiles/scottrade.xml
+@@ -0,0 +1,12 @@
++<?xml version="1.0" encoding="utf-8"?>
++<institution id="623">
++<name>Scottrade, Inc.</name>
++<fid>777</fid>
++<org>Scottrade</org>
++<brokerid>www.scottrade.com</brokerid>
++<url>https://ofxstl.scottsave.com</url>
++<ofxfail>0</ofxfail>
++<sslfail>4</sslfail>
++<lastofxvalidation>2012-08-13 22:28:10</lastofxvalidation>
++<lastsslvalidation>2011-09-28 22:22:22</lastsslvalidation>
++</institution>
+--- /dev/null
++++ b/ofxhome/tests/testfiles/search_america.xml
+@@ -0,0 +1,18 @@
++<?xml version="1.0" encoding="utf-8"?>
++<institutionlist>
++<institutionid name="America First Credit Union" id="533"/>
++<institutionid name="American Century Investments" id="739"/>
++<institutionid name="American Express Card" id="424"/>
++<institutionid name="American Funds" id="590"/>
++<institutionid name="American National Bank" id="669"/>
++<institutionid name="Bank of America" id="639"/>
++<institutionid name="Bank of America (All except CA, WA,&amp;ID)" id="472"/>
++<institutionid name="Bank of America (California)" id="635"/>
++<institutionid name="Bank of America (Formerly Fleet)" id="674"/>
++<institutionid name="Bank Of America(All except CA,WA,&amp;ID " id="661"/>
++<institutionid name="Mountain America Credit Union" id="657"/>
++<institutionid name="Premier America Credit Union" id="764"/>
++<institutionid name="RaboBank America" id="744"/>
++<institutionid name="SafeAmerica Credit Union" id="597"/>
++<institutionid name="Securities America" id="641"/>
++</institutionlist>
+--- /dev/null
++++ b/ofxhome/tests/testfiles/search_noexist.xml
+@@ -0,0 +1,12 @@
++<?xml version="1.0" encoding="utf-8"?>
++<institutionlist>
++<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
++
++<h4>A PHP Error was encountered</h4>
++
++<p>Severity: Warning</p>
++<p>Message: Invalid argument supplied for foreach()</p>
++<p>Filename: public_html/api.php</p>
++<p>Line Number: 37</p>
++
++</div></institutionlist>
diff --git a/debian/patches/missing-tests.diff b/debian/patches/missing-tests.diff
deleted file mode 100644
index 76b1fe8..0000000
--- a/debian/patches/missing-tests.diff
+++ /dev/null
@@ -1,162 +0,0 @@
---- /dev/null
-+++ b/tests/testfiles/badxml_bank.xml
-@@ -0,0 +1,3 @@
-+<?xml version="1.0" encoding="utf-8"?>
-+<institution id="623">
-+<name>
---- /dev/null
-+++ b/tests/testfiles/badxml_search.xml
-@@ -0,0 +1,2 @@
-+<?xml version="1.0" encoding="utf-8"?>
-+<institutionlist>
---- /dev/null
-+++ b/tests/testfiles/scottrade.xml
-@@ -0,0 +1,12 @@
-+<?xml version="1.0" encoding="utf-8"?>
-+<institution id="623">
-+<name>Scottrade, Inc.</name>
-+<fid>777</fid>
-+<org>Scottrade</org>
-+<brokerid>www.scottrade.com</brokerid>
-+<url>https://ofxstl.scottsave.com</url>
-+<ofxfail>0</ofxfail>
-+<sslfail>4</sslfail>
-+<lastofxvalidation>2012-08-13 22:28:10</lastofxvalidation>
-+<lastsslvalidation>2011-09-28 22:22:22</lastsslvalidation>
-+</institution>
---- /dev/null
-+++ b/tests/testfiles/search_america.xml
-@@ -0,0 +1,18 @@
-+<?xml version="1.0" encoding="utf-8"?>
-+<institutionlist>
-+<institutionid name="America First Credit Union" id="533"/>
-+<institutionid name="American Century Investments" id="739"/>
-+<institutionid name="American Express Card" id="424"/>
-+<institutionid name="American Funds" id="590"/>
-+<institutionid name="American National Bank" id="669"/>
-+<institutionid name="Bank of America" id="639"/>
-+<institutionid name="Bank of America (All except CA, WA,&amp;ID)" id="472"/>
-+<institutionid name="Bank of America (California)" id="635"/>
-+<institutionid name="Bank of America (Formerly Fleet)" id="674"/>
-+<institutionid name="Bank Of America(All except CA,WA,&amp;ID " id="661"/>
-+<institutionid name="Mountain America Credit Union" id="657"/>
-+<institutionid name="Premier America Credit Union" id="764"/>
-+<institutionid name="RaboBank America" id="744"/>
-+<institutionid name="SafeAmerica Credit Union" id="597"/>
-+<institutionid name="Securities America" id="641"/>
-+</institutionlist>
---- /dev/null
-+++ b/tests/testfiles/search_noexist.xml
-@@ -0,0 +1,12 @@
-+<?xml version="1.0" encoding="utf-8"?>
-+<institutionlist>
-+<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
-+
-+<h4>A PHP Error was encountered</h4>
-+
-+<p>Severity: Warning</p>
-+<p>Message: Invalid argument supplied for foreach()</p>
-+<p>Filename: public_html/api.php</p>
-+<p>Line Number: 37</p>
-+
-+</div></institutionlist>
---- /dev/null
-+++ b/tests/test_suite.py
-@@ -0,0 +1,93 @@
-+import sys, os
-+sys.path.append('..')
-+from ofxhome import OFXHome, Institution, InstitutionList
-+import unittest
-+import datetime
-+
-+class InstitutionTestCase(unittest.TestCase):
-+
-+ def testGoodParse(self):
-+ xml = testfile('scottrade.xml').read()
-+ i = Institution(xml)
-+ self.assertEquals(i.id,'623')
-+ self.assertEquals(i.name,'Scottrade, Inc.')
-+ self.assertEquals(i.fid,'777')
-+ self.assertEquals(i.org,'Scottrade')
-+ self.assertEquals(i.brokerid,'www.scottrade.com')
-+ self.assertEquals(i.url,'https://ofxstl.scottsave.com')
-+ self.assertEquals(i.ofxfail,'0')
-+ self.assertEquals(i.sslfail,'4')
-+ self.assertEquals(i.lastofxvalidation,datetime.datetime(2012,8,13,22,28,10))
-+ self.assertEquals(i.lastsslvalidation,datetime.datetime(2011,9,28,22,22,22))
-+ self.assertEquals(i.xml, xml)
-+
-+ def testFromFile(self):
-+ i = Institution.from_file( testfile_name('scottrade.xml') )
-+ self.assertEquals(i.id,'623')
-+ self.assertEquals(i['id'],'623')
-+
-+ def testDictKeys(self):
-+ xml = testfile('scottrade.xml').read()
-+ i = Institution(xml)
-+ self.assertEquals(i['id'],'623')
-+ self.assertEquals(i['name'],'Scottrade, Inc.')
-+
-+ i['id'] = '123'
-+ self.assertEquals(i['id'],'123')
-+
-+ def testBadParse(self):
-+ xml = testfile('badxml_bank.xml').read()
-+ try:
-+ l = Institution(xml)
-+ self.assertFalse(0)
-+ except Exception:
-+ self.assertTrue(1)
-+
-+class InstitutionListTestCase(unittest.TestCase):
-+
-+ def testFromFile(self):
-+ l = InstitutionList.from_file( testfile_name('search_america.xml') )
-+ self.assertEquals(len(l),15)
-+
-+ def testGoodResult(self):
-+ xml = testfile('search_america.xml').read()
-+ l = InstitutionList(xml)
-+ self.assertEquals(len(l),15)
-+ self.assertEquals(l.xml,xml)
-+ self.assertEquals(l[0]['id'],'533')
-+ self.assertEquals(l[0]['name'],'America First Credit Union')
-+
-+ def testResultWithPHPError(self):
-+ xml = testfile('search_noexist.xml').read()
-+ l = InstitutionList(xml)
-+ self.assertEquals(len(l),0)
-+ self.assertEquals(l.xml,xml)
-+
-+ def testIterator(self):
-+ count = 0
-+ xml = testfile('search_america.xml').read()
-+ l = InstitutionList(xml)
-+ for i in l:
-+ count += 1
-+ self.assertEquals(count,15)
-+
-+ def testBadXML(self):
-+ xml = testfile('badxml_search.xml').read()
-+ try:
-+ l = InstitutionList(xml)
-+ self.assertFalse(0)
-+ except Exception:
-+ self.assertTrue(1)
-+
-+def testfile_name(filename):
-+ path = 'testfiles/' + filename
-+ if ('tests' in os.listdir('.')):
-+ path = 'tests/' + path
-+ return path
-+
-+def testfile(filename):
-+ return file(testfile_name(filename))
-+
-+
-+if __name__ == '__main__':
-+ unittest.main()
---- /dev/null
-+++ b/tests/__init__.py
-@@ -0,0 +1 @@
-+#
diff --git a/debian/patches/series b/debian/patches/series
index 25693fd..0bcadf9 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1 @@
-missing-tests.diff
+missing-testfiles.diff
diff --git a/ofxhome.egg-info/PKG-INFO b/ofxhome.egg-info/PKG-INFO
index e9bca55..daf535c 100644
--- a/ofxhome.egg-info/PKG-INFO
+++ b/ofxhome.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
-Metadata-Version: 1.0
+Metadata-Version: 1.1
Name: ofxhome
-Version: 0.3.1
+Version: 0.3.2
Summary: ofxhome.com financial institution lookup REST client
Home-page: https://github.com/captin411/ofxhome
Author: David Bartle
@@ -25,6 +25,7 @@ Description: ofxhome
example
=======
+ ```python
from ofxhome import OFXHome
s = OFXHome.search("USAA")
@@ -36,6 +37,7 @@ Description: ofxhome
bank = OFXHome.lookup(item.id)
print bank.name _ bank.fid _ bank.url _ bank.brokerid # OR
print bank['name'] _ bank['fid'] _ bank['url'] _ bank['brokerid']
+ ```
Keywords: ofx,Open Financial Exchange,bank search,ofxhome,ofxhome.com
Platform: UNKNOWN
diff --git a/ofxhome.egg-info/SOURCES.txt b/ofxhome.egg-info/SOURCES.txt
index 2c69c46..c3daabd 100644
--- a/ofxhome.egg-info/SOURCES.txt
+++ b/ofxhome.egg-info/SOURCES.txt
@@ -7,4 +7,6 @@ ofxhome.egg-info/SOURCES.txt
ofxhome.egg-info/dependency_links.txt
ofxhome.egg-info/entry_points.txt
ofxhome.egg-info/top_level.txt
-ofxhome.egg-info/zip-safe \ No newline at end of file
+ofxhome.egg-info/zip-safe
+ofxhome/tests/__init__.py
+ofxhome/tests/test_suite.py \ No newline at end of file
diff --git a/ofxhome/__init__.py b/ofxhome/__init__.py
index 6ca3aeb..c18a369 100644
--- a/ofxhome/__init__.py
+++ b/ofxhome/__init__.py
@@ -2,7 +2,7 @@ import urllib
from datetime import datetime
from xml.dom.minidom import parseString
-__version__ = '0.3.1'
+__version__ = '0.3.2'
API_URL='http://www.ofxhome.com/api.php'
@@ -61,7 +61,10 @@ def _attr(node,name):
def _text(parent,name):
rc = []
- for node in parent.getElementsByTagName(name)[0].childNodes:
+ elements = parent.getElementsByTagName(name)
+ if not elements:
+ return ''
+ for node in elements[0].childNodes:
if node.nodeType == node.TEXT_NODE:
rc.append(node.data)
return ''.join(rc)
diff --git a/ofxhome/tests/__init__.py b/ofxhome/tests/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/ofxhome/tests/__init__.py
diff --git a/ofxhome/tests/test_suite.py b/ofxhome/tests/test_suite.py
new file mode 100644
index 0000000..92f0b98
--- /dev/null
+++ b/ofxhome/tests/test_suite.py
@@ -0,0 +1,109 @@
+import sys, os, os.path
+from ofxhome import OFXHome, Institution, InstitutionList
+import unittest
+import datetime
+
+class InstitutionTestCase(unittest.TestCase):
+
+ def testGoodParse(self):
+ xml = testfile('scottrade.xml').read()
+ i = Institution(xml)
+ self.assertEquals(i.id,'623')
+ self.assertEquals(i.name,'Scottrade, Inc.')
+ self.assertEquals(i.fid,'777')
+ self.assertEquals(i.org,'Scottrade')
+ self.assertEquals(i.brokerid,'www.scottrade.com')
+ self.assertEquals(i.url,'https://ofxstl.scottsave.com')
+ self.assertEquals(i.ofxfail,'0')
+ self.assertEquals(i.sslfail,'4')
+ self.assertEquals(i.lastofxvalidation,datetime.datetime(2012,8,13,22,28,10))
+ self.assertEquals(i.lastsslvalidation,datetime.datetime(2011,9,28,22,22,22))
+ self.assertEquals(i.xml, xml)
+
+ def testOptionalBroker(self):
+ xml = testfile('jpmorgan.xml').read()
+ i = Institution(xml)
+ self.assertEquals(i.id,'435')
+ self.assertEquals(i.name,'JPMorgan Chase Bank')
+ self.assertEquals(i.fid,'1601')
+ self.assertEquals(i.org,'Chase Bank')
+ self.assertEquals(i.brokerid,'')
+ self.assertEquals(i.url,'https://www.oasis.cfree.com/1601.ofxgp')
+ self.assertEquals(i.ofxfail,'0')
+ self.assertEquals(i.sslfail,'0')
+ self.assertEquals(i.lastofxvalidation,datetime.datetime(2014,8,17,22,23,35))
+ self.assertEquals(i.lastsslvalidation,datetime.datetime(2014,8,17,22,23,34))
+ self.assertEquals(i.xml, xml)
+
+ def testFromFile(self):
+ i = Institution.from_file( testfile_name('scottrade.xml') )
+ self.assertEquals(i.id,'623')
+ self.assertEquals(i['id'],'623')
+
+ def testDictKeys(self):
+ xml = testfile('scottrade.xml').read()
+ i = Institution(xml)
+ self.assertEquals(i['id'],'623')
+ self.assertEquals(i['name'],'Scottrade, Inc.')
+
+ i['id'] = '123'
+ self.assertEquals(i['id'],'123')
+
+ def testBadParse(self):
+ xml = testfile('badxml_bank.xml').read()
+ try:
+ l = Institution(xml)
+ self.assertFalse(0)
+ except Exception:
+ self.assertTrue(1)
+
+class InstitutionListTestCase(unittest.TestCase):
+
+ def testFromFile(self):
+ l = InstitutionList.from_file( testfile_name('search_america.xml') )
+ self.assertEquals(len(l),15)
+
+ def testGoodResult(self):
+ xml = testfile('search_america.xml').read()
+ l = InstitutionList(xml)
+ self.assertEquals(len(l),15)
+ self.assertEquals(l.xml,xml)
+ self.assertEquals(l[0]['id'],'533')
+ self.assertEquals(l[0]['name'],'America First Credit Union')
+
+ def testResultWithPHPError(self):
+ xml = testfile('search_noexist.xml').read()
+ l = InstitutionList(xml)
+ self.assertEquals(len(l),0)
+ self.assertEquals(l.xml,xml)
+
+ def testIterator(self):
+ count = 0
+ xml = testfile('search_america.xml').read()
+ l = InstitutionList(xml)
+ for i in l:
+ count += 1
+ self.assertEquals(count,15)
+
+ def testBadXML(self):
+ xml = testfile('badxml_search.xml').read()
+ try:
+ l = InstitutionList(xml)
+ self.assertFalse(0)
+ except Exception:
+ self.assertTrue(1)
+
+def testfile_name(filename):
+ base_path = os.path.dirname(os.path.abspath(__file__))
+
+ path = os.path.join(base_path,'testfiles',filename)
+ if ('tests' in os.listdir('.')):
+ path = os.path.join('tests',path)
+ return path
+
+def testfile(filename):
+ return file(testfile_name(filename))
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/setup.py b/setup.py
index 0bdc1dc..ec8b736 100644
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages
setup(name='ofxhome',
- version="0.3.1",
+ version="0.3.2",
description="ofxhome.com financial institution lookup REST client",
long_description=open("./README", "r").read(),
classifiers=[
@@ -19,11 +19,11 @@ setup(name='ofxhome',
author_email='captindave@gmail.com',
url='https://github.com/captin411/ofxhome',
license='MIT License',
- packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
+ packages=find_packages(exclude=['ez_setup', 'examples']),
include_package_data=True,
zip_safe=True,
install_requires=[ ],
- test_suite = 'tests',
+ test_suite = 'ofxhome.tests',
entry_points="""
""",
)