Merge pull request #27 from resync/develop

Fix silly error introduced on resync-explorer in v1.0.6
This commit is contained in:
Simeon Warner 2017-03-27 14:09:35 -04:00 committed by GitHub
commit 1829858f20
5 changed files with 43 additions and 4 deletions

View File

@ -6,6 +6,9 @@ core specification version. Versions 1.0.x implement the v1.0
ResourceSync specification which was standardized as ANSI/NISO Z39.99-2014
<http://www.openarchives.org/rs/1.0/toc>.
v1.0.7 2017-03-27
* Fixed silly error in `resync-explorer` introduced in 1.0.6
v1.0.6 2017-03-20
* Fixed md5 hash format (https://github.com/resync/resync/issues/25)
* Added support for sha-1 and sha-256 hashes

View File

@ -100,7 +100,7 @@ def main():
print("----- ResourceSync Explorer -----")
if (args.checksum):
args.hash.append('md5')
c = Explorer(hashes=args.hashes,
c = Explorer(hashes=args.hash,
verbose=args.verbose)
try:

View File

@ -3,4 +3,4 @@
# Format: x.y.z where
# x.y is spec version, see http://www.openarchives.org/rs/x.y/
# z is incremented for revisions within that version, 1...
__version__ = '1.0.6'
__version__ = '1.0.7'

View File

@ -63,10 +63,12 @@ setup(
install_requires=[
"requests",
"python-dateutil>=1.5",
"defusedxml>=0.4.1",
"testfixtures"
"defusedxml>=0.4.1"
],
test_suite="tests",
tests_require=[
"testfixtures"
],
cmdclass={
'coverage': Coverage
}

View File

@ -0,0 +1,34 @@
import subprocess
import sys
import unittest
try: # python2
# Must try this first as io also exists in python2
# but in the wrong one!
import BytesIO as io
except ImportError: # python3
import io
def run_resync_explorer(args):
args.insert(0, 'bin/resync-explorer')
proc = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(out, err) = proc.communicate()
return(out, err)
class TestClientLinkOptions(unittest.TestCase):
def test01_help(self):
"""Check that it runs with -h."""
txt = run_resync_explorer(['-h'])[0]
self.assertTrue(txt.startswith(b'Usage: resync-explorer [options] uri'))
def test02_error(self):
"""Bad parameter."""
err = run_resync_explorer([])[1]
self.assertRegexpMatches(err, b'FatalError: No source information')
if __name__ == '__main__':
suite = unittest.TestLoader().loadTestsFromTestCase(TestClientLinkOptions)
unittest.TextTestRunner(verbosity=2).run(suite)