Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Meaningless, but add version test to increase cov
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |