Skip to content

Commit

Permalink
Merge pull request #45 from jd-boyd/travis_versions
Browse files Browse the repository at this point in the history
Expand versions tested via travis.
  • Loading branch information
jd-boyd committed Nov 1, 2019
2 parents 41a48ea + 9224f12 commit c687d83
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 40 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Expand Up @@ -3,6 +3,8 @@ python:
- 2.7
- 3.4
- 3.5
- 3.6
- 3.7
env:
- LC_ALL=C
before_install:
Expand Down
43 changes: 3 additions & 40 deletions tests/test.py
Expand Up @@ -101,6 +101,9 @@ def test_lzo():
yield gen_raw, b"abcabcabcabcabcabcabcabc"
yield gen, b"abcabcabcabcabcabcabcabc", 9
yield gen_raw, b"abcabcabcabcabcabcabcabc", 9


def test_lzo_empty():
yield gen, b""
yield gen_raw, b""

Expand All @@ -111,43 +114,3 @@ def test_lzo_big():

def test_lzo_raw_big():
gen_raw(b" " * 131072)


def main(args):
# display version information and module documentation
print("LZO version %s (0x%x), %s" % (lzo.LZO_VERSION_STRING, lzo.LZO_VERSION, lzo.LZO_VERSION_DATE))
print(lzo.__file__)
print()
print(lzo.__doc__)

# display additional module information
## print dir(lzo)
## print_modinfo()

# compress some simple strings
gen(b"aaaaaaaaaaaaaaaaaaaaaaaa")
gen_raw(b"aaaaaaaaaaaaaaaaaaaaaaaa")
gen(b"abcabcabcabcabcabcabcabc")
gen_raw(b"abcabcabcabcabcabcabcabc")
gen(b"abcabcabcabcabcabcabcabc", level=9)
gen_raw(b"abcabcabcabcabcabcabcabc", level=9)
gen(b" " * 131072)
gen_raw(b" " * 131072)
gen(b"")
gen_raw(b"")
print("Simple compression test passed.")

test_version()

# force an exception (because of invalid compressed data)
assert issubclass(lzo.error, Exception)
try:
x = lzo.decompress("xx")
except lzo.error:
pass
else:
print("Exception handling does NOT work !")
return 0

if __name__ == '__main__':
sys.exit(main(sys.argv))

0 comments on commit c687d83

Please sign in to comment.