Source

cffi / testing / test_version.py

The branch 'release-0.4' does not exist.
Armin Rigo f8991af 
Armin Rigo e96c7e1 



Armin Rigo 229cea8 

Armin Rigo e96c7e1 




Amaury Forgeot d… 203dc42 
Armin Rigo e96c7e1 



Armin Rigo f8991af 



Armin Rigo ea8e5e9 
Amaury Forgeot d… 203dc42 
Armin Rigo f8991af 

Armin Rigo aa00674 






import py, os
import cffi, _cffi_backend

def test_version():
    v = cffi.__version__
    version_info = '.'.join(str(i) for i in cffi.__version_info__)
    assert v == version_info
    assert v == _cffi_backend.__version__

def test_doc_version():
    parent = os.path.dirname(os.path.dirname(__file__))
    p = os.path.join(parent, 'doc', 'source', 'conf.py')
    content = open(p).read()
    #
    v = cffi.__version__
    assert ("version = '%s'\n" % v) in content
    assert ("release = '%s'\n" % v) in content

def test_doc_version_file():
    parent = os.path.dirname(os.path.dirname(__file__))
    v = cffi.__version__
    p = os.path.join(parent, 'doc', 'source', 'index.rst')
    content = open(p).read()
    if ("cffi/cffi-%s.tar.gz" % v) not in content:
        py.test.skip("XXX fix the file referenced by the doc!")

def test_setup_version():
    parent = os.path.dirname(os.path.dirname(__file__))
    p = os.path.join(parent, 'setup.py')
    content = open(p).read()
    #
    v = cffi.__version__
    assert ("version='%s'" % v) in content