Skip to content

Commit

Permalink
Meaningless, but add version test to increase cov
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlia committed May 29, 2013
1 parent caa7f68 commit 78320e6
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/version_test.py
@@ -0,0 +1,30 @@
import collections
import numbers
import os

from sqlalchemy import __version__
from sqlalchemy_imageattach.version import VERSION, VERSION_INFO


def test_version_info():
assert isinstance(VERSION_INFO, collections.Sequence)
assert len(VERSION_INFO) == 3
assert isinstance(VERSION_INFO[0], numbers.Integral)
assert isinstance(VERSION_INFO[1], numbers.Integral)
assert isinstance(VERSION_INFO[2], numbers.Integral)


def test_sqlalchemy_version():
assert map(int, __version__.split('.')[:2]) == list(VERSION_INFO[:2])
assert __version__.split('.')[:2] == VERSION.split('.')[:2]


def test_version():
assert isinstance(VERSION, str)
assert map(int, VERSION.split('.')) == list(VERSION_INFO)


def test_print():
with os.popen('python -m sqlalchemy_imageattach.version') as pipe:
printed_version = pipe.read().strip()
assert printed_version == VERSION

0 comments on commit 78320e6

Please sign in to comment.