diff options
author | Clint Adams <clint@debian.org> | 2014-02-25 13:03:49 -0500 |
---|---|---|
committer | Andrew Shadura <andrewsh@debian.org> | 2016-10-19 17:41:10 +0200 |
commit | b2b99ed24be5431d97ef803802ec09b88a70673e (patch) | |
tree | 597da8e654902752bf9368fcf2e4f9b2641b2e5d | |
parent | 7fe4ae7c48cfd06ebee0e7a02077c998b83b1c38 (diff) |
Imported Debian patch 1.3.8-1
-rw-r--r-- | debian/changelog | 5 | ||||
-rw-r--r-- | debian/compat | 1 | ||||
-rw-r--r-- | debian/control | 21 | ||||
-rw-r--r-- | debian/copyright | 33 | ||||
-rw-r--r-- | debian/patches/missing-tests.diff | 404 | ||||
-rw-r--r-- | debian/patches/series | 1 | ||||
-rw-r--r-- | debian/python-ofxparse.docs | 1 | ||||
-rw-r--r-- | debian/python3-ofxparse.docs | 1 | ||||
-rwxr-xr-x | debian/rules | 10 | ||||
-rw-r--r-- | debian/source/format | 1 | ||||
-rw-r--r-- | debian/watch | 3 |
11 files changed, 481 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..23c6b11 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +python-ofxclient (1.3.8-1) unstable; urgency=low + + * Initial release. + + -- Clint Adams <clint@debian.org> Tue, 25 Feb 2014 13:03:49 -0500 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..b8cbda8 --- /dev/null +++ b/debian/control @@ -0,0 +1,21 @@ +Source: python-ofxclient +Section: python +Priority: optional +Maintainer: Clint Adams <clint@debian.org> +Build-Depends: debhelper (>= 9) + , dh-python + , python-all (>= 2.7~) + , python-setuptools + , python-argparse + , python-beautifulsoup (>= 3.0) + , python-keyring + , python-ofxparse (>= 0.8) +Standards-Version: 3.9.5 +Homepage: https://sites.google.com/site/ofxparse/ +X-Python-Version: >= 2.6 + +Package: python-ofxclient +Architecture: all +Depends: ${python:Depends}, ${misc:Depends} +Description: OFX client for dowloading transactions from banks + Simple ofxclient command line utility and OFX client libraries for development. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..b89461d --- /dev/null +++ b/debian/copyright @@ -0,0 +1,33 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: ofxclient +Source: https://pypi.python.org/pypi/ofxclient + +Files: * +Copyright: 2012 David Bartle +License: Expat + +Files: debian/* +Copyright: 2014 Clint Adams <clint@debian.org> +License: Expat + +License: Expat + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following + conditions: + . + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. diff --git a/debian/patches/missing-tests.diff b/debian/patches/missing-tests.diff new file mode 100644 index 0000000..3d013e9 --- /dev/null +++ b/debian/patches/missing-tests.diff @@ -0,0 +1,404 @@ +--- /dev/null ++++ b/tests/account.py +@@ -0,0 +1,83 @@ ++import unittest ++from ofxclient import Account ++from ofxclient import BankAccount ++from ofxclient import BrokerageAccount ++from ofxclient import CreditCardAccount ++from ofxclient import Institution ++ ++class OfxAccountTests(unittest.TestCase): ++ ++ def setUp(self): ++ institution = Institution( ++ id = '1', ++ org = 'Example', ++ url = 'http://example.com', ++ username = 'username', ++ password = 'password' ++ ) ++ self.institution = institution ++ ++ def testNumberRequired(self): ++ a = { 'institution': self.institution } ++ self.assertRaises(TypeError,Account,**a) ++ ++ def testInstitutionRequired(self): ++ a = { 'number': '12345' } ++ self.assertRaises(TypeError,Account,**a) ++ ++ def testMasked(self): ++ account = Account( ++ number = '12345', ++ institution = self.institution ++ ) ++ self.assertEqual( account.number_masked(), '***2345' ) ++ account.number = '1234' ++ self.assertEqual( account.number_masked(), '***1234' ) ++ account.number = '123' ++ self.assertEqual( account.number_masked(), '***123' ) ++ account.number = '12' ++ self.assertEqual( account.number_masked(), '***12' ) ++ account.number = '1' ++ self.assertEqual( account.number_masked(), '***1' ) ++ ++ def testDescription(self): ++ account = Account( ++ number = '12345', ++ institution = self.institution ++ ) ++ self.assertEqual( account.description, '***2345', 'kwarg is not required and defaults' ) ++ ++ account = Account( ++ number = '12345', ++ institution = self.institution, ++ description = None ++ ) ++ self.assertEqual( account.description, '***2345', 'None defaults' ) ++ ++ account = Account( ++ number = '12345', ++ institution = self.institution, ++ description = '' ++ ) ++ self.assertEqual( account.description, '***2345', 'empty string desc defaults') ++ ++ account = Account( ++ number = '12345', ++ institution = self.institution, ++ description = '0' ++ ) ++ self.assertEqual( account.description, '0', '0 string is preserved') ++ ++ account = Account( ++ number = '12345', ++ institution = self.institution, ++ description = 'passed' ++ ) ++ self.assertEqual( account.description, 'passed' ) ++ ++ def testNoInstitution(self): ++ account = Account( ++ number = '12345', ++ institution = None ++ ) ++ +--- /dev/null ++++ b/tests/institution.py +@@ -0,0 +1,78 @@ ++import unittest ++from ofxclient import Client ++from ofxclient import Institution ++ ++class OfxInstitutionTests(unittest.TestCase): ++ ++ def testClientDefaultsPreserved(self): ++ i = Institution( ++ id='1', ++ org='org', ++ url='http://example.com', ++ username='username', ++ password='password' ++ ) ++ ++ c = Client(institution=i) ++ ic = i.client() ++ ++ self.assertEqual( c.id, ic.id ) ++ self.assertEqual( c.app_id, ic.app_id ) ++ self.assertEqual( c.app_version, ic.app_version ) ++ self.assertEqual( c.ofx_version, ic.ofx_version ) ++ ++ def testClientSomeOverride(self): ++ i = Institution( ++ id='1', ++ org='org', ++ url='http://example.com', ++ username='username', ++ password='password', ++ client_args = { ++ 'app_id': 'capp_id', ++ } ++ ) ++ ++ c = Client(institution=i) ++ ic = i.client() ++ self.assertEqual( ic.app_id, 'capp_id', 'overridden app_id') ++ self.assertNotEqual( ic.app_id, c.app_id, 'overridden app_id') ++ self.assertEqual( ic.id, c.id, 'default id') ++ self.assertEqual( ic.app_version, c.app_version, 'default app version') ++ self.assertEqual( ic.ofx_version, c.ofx_version, 'default ofx version') ++ ++ def testClientAllOverride(self): ++ i = Institution( ++ id='1', ++ org='org', ++ url='http://example.com', ++ username='username', ++ password='password', ++ client_args = { ++ 'id': 'cid', ++ 'app_id': 'capp_id', ++ 'app_version': 'capp_version', ++ 'ofx_version': 'cofx_version' ++ } ++ ) ++ ++ c = i.client() ++ self.assertEqual( c.id, 'cid' ) ++ self.assertEqual( c.app_id, 'capp_id' ) ++ self.assertEqual( c.app_version, 'capp_version' ) ++ self.assertEqual( c.ofx_version, 'cofx_version' ) ++ ++ def testRequiredParams(self): ++ self.assertRaises(TypeError,Institution.__init__) ++ ++ a = { 'id': '1' } ++ self.assertRaises(TypeError,Institution,**a) ++ ++ a = { 'id': '1', 'org': 'org' } ++ self.assertRaises(TypeError,Institution,**a) ++ ++ a = { 'id': '1', 'org': 'org', 'url': 'url' } ++ self.assertRaises(TypeError,Institution,**a) ++ ++ a = { 'id': '1', 'org': 'org', 'url': 'url', 'username': 'username' } ++ self.assertRaises(TypeError,Institution,**a) +--- /dev/null ++++ b/tests/ofxconfig.py +@@ -0,0 +1,121 @@ ++import unittest ++import tempfile ++import os ++import os.path ++import ofxclient.config ++from ofxclient.config import OfxConfig ++from ofxclient import Institution, CreditCardAccount ++import StringIO ++ ++ ++ ++class OfxConfigTests(unittest.TestCase): ++ ++ def setUp(self): ++ self.temp_file = tempfile.NamedTemporaryFile() ++ ++ def tearDown(self): ++ self.temp_file.close() ++ ++ def testFileCreated(self): ++ file_name = self.temp_file.name ++ self.temp_file.close() ++ ++ self.assertFalse(os.path.exists(file_name)) ++ ++ c = OfxConfig(file_name=file_name) ++ self.assertTrue(os.path.exists(file_name)) ++ ++ os.remove(file_name) ++ ++ def testAddAccount(self): ++ c = OfxConfig(file_name=self.temp_file.name) ++ ++ i = Institution(id='1',org='org',url='url',username='user',password='pass') ++ a = CreditCardAccount(institution=i,number='12345') ++ ++ c.add_account(a) ++ self.assertEqual( len(c.accounts()), 1 ) ++ self.assertEqual( c.account(a.local_id()).local_id(), a.local_id() ) ++ ++ def testLoadFromFile(self): ++ c = OfxConfig(file_name=self.temp_file.name) ++ i = Institution(id='1',org='org',url='url',username='user',password='pass') ++ a = CreditCardAccount(institution=i,number='12345') ++ c.add_account(a) ++ c.save() ++ ++ c = OfxConfig(file_name=self.temp_file.name) ++ got = c.account(a.local_id()) ++ self.assertEqual( len(c.accounts()), 1 ) ++ self.assertEqual( got.local_id(), a.local_id() ) ++ self.assertEqual( got.number, a.number ) ++ self.assertEqual( got.institution.local_id(), a.institution.local_id() ) ++ self.assertEqual( got.institution.id, a.institution.id ) ++ self.assertEqual( got.institution.org, a.institution.org ) ++ self.assertEqual( got.institution.url, a.institution.url ) ++ self.assertEqual( got.institution.username, a.institution.username ) ++ self.assertEqual( got.institution.password, a.institution.password ) ++ ++ def testFieldsSecured(self): ++ if not ofxclient.config.KEYRING_AVAILABLE: ++ return ++ ++ c = OfxConfig(file_name=self.temp_file.name) ++ ++ i = Institution(id='1',org='org',url='url',username='user',password='pass') ++ a = CreditCardAccount(institution=i,number='12345') ++ c.add_account(a) ++ ++ self.assertTrue( c.parser.is_secure_option(a.local_id(),'institution.username') ) ++ self.assertTrue( c.parser.is_secure_option(a.local_id(),'institution.password') ) ++ ++ def testFieldsRemainUnsecure(self): ++ if not ofxclient.config.KEYRING_AVAILABLE: ++ return ++ ++ c = OfxConfig(file_name=self.temp_file.name) ++ i = Institution(id='1',org='org',url='url',username='user',password='pass') ++ a = CreditCardAccount(institution=i,number='12345') ++ c.add_account(a) ++ ++ # pretend the user put their password in there in the clear on purpose ++ c.parser.remove_option(a.local_id(),'institution.password') ++ c.parser.set(a.local_id(),'institution.password','pass') ++ c.save() ++ ++ c = OfxConfig(file_name=self.temp_file.name) ++ self.assertTrue( c.parser.is_secure_option(a.local_id(),'institution.username') ) ++ self.assertFalse( c.parser.is_secure_option(a.local_id(),'institution.password') ) ++ ++ def testResecuredAfterEncryptAccount(self): ++ if not ofxclient.config.KEYRING_AVAILABLE: ++ return ++ ++ c = OfxConfig(file_name=self.temp_file.name) ++ i = Institution(id='1',org='org',url='url',username='user',password='pass') ++ a1 = CreditCardAccount(institution=i,number='12345') ++ c.add_account(a1) ++ a2 = CreditCardAccount(institution=i,number='67890') ++ c.add_account(a2) ++ ++ # pretend the user put their password in there in the clear on purpose ++ # to fix something... and then wants it to be resecured later on ++ c.parser.remove_option(a1.local_id(),'institution.password') ++ c.parser.set(a1.local_id(),'institution.password','pass') ++ c.save() ++ ++ c = OfxConfig(file_name=self.temp_file.name) ++ self.assertEqual( len(c.accounts()), 2 ) ++ self.assertEqual( len(c.encrypted_accounts()), 1 ) ++ self.assertEqual( len(c.unencrypted_accounts()), 1 ) ++ self.assertTrue( c.parser.is_secure_option(a1.local_id(),'institution.username') ) ++ self.assertFalse( c.parser.is_secure_option(a1.local_id(),'institution.password') ) ++ ++ c.encrypt_account(a1.local_id()) ++ self.assertEqual( len(c.accounts()), 2 ) ++ self.assertEqual( len(c.encrypted_accounts()), 2 ) ++ self.assertEqual( len(c.unencrypted_accounts()), 0 ) ++ self.assertTrue( c.parser.is_secure_option(a1.local_id(),'institution.username') ) ++ self.assertTrue( c.parser.is_secure_option(a1.local_id(),'institution.password') ) ++ +--- /dev/null ++++ b/tests/secure_config.py +@@ -0,0 +1,106 @@ ++import unittest ++from ofxclient.config import SecurableConfigParser ++from ConfigParser import ConfigParser, NoOptionError ++ ++def makeConfig(keyring_available=True,**kwargs): ++ conf = None ++ conf = SecurableConfigParser(keyring_available=keyring_available,**kwargs) ++ conf.add_section('section1') ++ conf.add_section('section2') ++ conf.set('section1','username','USERNAME') ++ conf.set_secure('section1','password','PASSWORD') ++ conf.set('section2','question','answer') ++ conf.set_secure('section2','ssn','111-11-1111') ++ return conf ++ ++class IdentifySecureOptionTests(unittest.TestCase): ++ ++ def testIsSecureOption(self): ++ c = makeConfig() ++ self.assertTrue(c.is_secure_option('section1','password')) ++ self.assertTrue(c.is_secure_option('section2','ssn')) ++ self.assertFalse(c.is_secure_option('section1','username')) ++ self.assertFalse(c.is_secure_option('section2','question')) ++ ++ def testStaysSecure(self): ++ c = makeConfig() ++ self.assertTrue(c.is_secure_option('section1','password')) ++ c.set('section1','password','MYPASS') ++ self.assertTrue(c.is_secure_option('section1','password')) ++ ++ def testStaysUnsecure(self): ++ c = makeConfig() ++ self.assertFalse(c.is_secure_option('section1','username')) ++ c.set('section1','username','MYUSER') ++ self.assertFalse(c.is_secure_option('section1','username')) ++ ++ def testSetThenSetSecureTurnsSecure(self): ++ c = makeConfig() ++ c.set('section1','foo','bar') ++ self.assertFalse(c.is_secure_option('section1','foo')) ++ c.set_secure('section1','foo','bar') ++ self.assertTrue(c.is_secure_option('section1','foo')) ++ c.set('section1','foo','bar') ++ self.assertTrue(c.is_secure_option('section1','foo')) ++ ++ def testItemsHavePasswords(self): ++ c = makeConfig() ++ items = sorted(c.items('section1')) ++ self.assertEqual( items, [ ('password','PASSWORD'), ('username','USERNAME') ] ) ++ self.assertEqual( len(items), 2 ) ++ ++ def testSecureItems(self): ++ c = makeConfig() ++ items = sorted(c.secure_items('section1')) ++ self.assertEqual( items, [ ('password','PASSWORD') ] ) ++ self.assertEqual( len(items), 1 ) ++ c.remove_option('section1','password') ++ items = sorted(c.secure_items('section1')) ++ self.assertEqual( len(items), 0 ) ++ ++ def testGet(self): ++ c = makeConfig() ++ self.assertEqual( c.get('section1','password'), 'PASSWORD' ) ++ self.assertNotEqual( ConfigParser.get(c,'section1','password'), 'PASSWORD' ) ++ self.assertEqual( c.get('section1','username'), 'USERNAME' ) ++ c.remove_option('section1','password') ++ self.assertRaises(NoOptionError,c.get,'section1','password') ++ ++ def testUnsavedOptions(self): ++ c = makeConfig() ++ s_option = "%s%s" % ('section1','foo2') ++ ++ c.set('section1','foo2','bar2') ++ self.assertFalse( s_option in c._unsaved ) ++ ++ c.remove_option('section1','foo2') ++ self.assertFalse( s_option in c._unsaved ) ++ ++ c.set_secure('section1','foo2','bar2') ++ self.assertTrue( s_option in c._unsaved ) ++ self.assertTrue( c._unsaved[s_option][0] == 'set' ) ++ self.assertTrue( c._unsaved[s_option][1] == 'bar2' ) ++ ++ c.remove_option('section1','foo2') ++ self.assertTrue( s_option in c._unsaved ) ++ self.assertTrue( c._unsaved[s_option][0] == 'delete' ) ++ self.assertTrue( c._unsaved[s_option][1] == None ) ++ ++ def testKeyringOffSet(self): ++ c = makeConfig(keyring_available=False) ++ self.assertFalse( c.is_secure_option('section1','username') ) ++ self.assertFalse( c.is_secure_option('section1','password') ) ++ ++ self.assertEqual( c._unsaved, {} ) ++ ++ c.set_secure('section1','password','PASSWORD') ++ self.assertFalse( c.is_secure_option('section1','password') ) ++ ++ self.assertEqual( c.get('section1','password'),'PASSWORD' ) ++ self.assertEqual( c.get('section1','username'),'USERNAME' ) ++ ++ c.remove_option('section1','password') ++ self.assertFalse( c.is_secure_option('section1','password') ) ++ self.assertEqual( c._unsaved, {} ) ++ ++ pass +--- /dev/null ++++ b/tests/__init__.py +@@ -0,0 +1 @@ ++# diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..25693fd --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +missing-tests.diff diff --git a/debian/python-ofxparse.docs b/debian/python-ofxparse.docs new file mode 100644 index 0000000..e845566 --- /dev/null +++ b/debian/python-ofxparse.docs @@ -0,0 +1 @@ +README diff --git a/debian/python3-ofxparse.docs b/debian/python3-ofxparse.docs new file mode 100644 index 0000000..e845566 --- /dev/null +++ b/debian/python3-ofxparse.docs @@ -0,0 +1 @@ +README diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..495db8b --- /dev/null +++ b/debian/rules @@ -0,0 +1,10 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +#export DH_VERBOSE=1 +export PYBUILD_NAME=ofxclient +export PYBUILD_DISABLE=test + + +%: + dh $@ --with python2 --buildsystem=pybuild diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..e3e6c9b --- /dev/null +++ b/debian/watch @@ -0,0 +1,3 @@ +version=3 +opts=uversionmangle=s/(rc|dev|a|b|c)/~$1/ \ + https://pypi.python.org/packages/source/o/ofxclient/ofxclient-(.*)\.(?:tar\.gz|zip|tar\.bz2) |