~smoser/simplestreams/trunk.moved-to-git

« back to all changes in this revision

Viewing changes to tests/unittests/test_glancemirror.py

  • Committer: Scott Moser
  • Date: 2016-08-03 16:02:50 UTC
  • mfrom: (439.1.23 enable-tox)
  • Revision ID: smoser@ubuntu.com-20160803160250-9hjl6tgu0u0bgjjx
add running of tox.

This primarily moves a lot of things around to enable tox.
Some things here:
 * add ./tools/install-deps
   this allows easily installing dependencies to build or run tox
   (the openstack libraries require some c python extentions so
   you end up needing python-dev and such in order to run tox).

 * add tools/create-gpgdir and tools/sign-examples
   this just moves that logic out of Makefile to these places.

 * make tools/js2signed only re-create .sjson and .json.gpg
   files if the .json is newer. It supports '--force' to disable
   this logic.

 * move to using flake8 instead of pyflakes and pep8
   (flake8 uses pyflakes and pep8)

 * debian/control drop python-glanceclient and python3-keystoneclient
   these aren't available in trusty and thus can't build if they
   are there.  Also adjusted tests to skip these if not present.

 * split signjson_file out of toolutil as toolutil required
   distroinfo which is only needed by make testdata.

 * add a trusty-flake8 tox environment for testing versions
   of flake8, pep8, and pyflakes that are on trusty.  This allows
   us to catch what would be trusty specific build failures in tox.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
from simplestreams.contentsource import MemoryContentSource
2
 
from simplestreams.mirrors.glance import GlanceMirror
3
 
from simplestreams.objectstores import MemoryObjectStore
 
2
try:
 
3
    from simplestreams.mirrors.glance import GlanceMirror
 
4
    from simplestreams.objectstores import MemoryObjectStore
 
5
    HAVE_OPENSTACK_LIBS = True
 
6
except ImportError:
 
7
    HAVE_OPENSTACK_LIBS = False
 
8
 
4
9
import simplestreams.util
5
10
 
6
11
import copy
7
12
import json
8
13
import os
9
 
from unittest import TestCase
 
14
from unittest import TestCase, skipIf
10
15
 
11
16
 
12
17
# This is a real snippet from the simplestreams index entry for
118
123
        self.images = FakeImages()
119
124
 
120
125
 
 
126
@skipIf(not HAVE_OPENSTACK_LIBS, "no python3 openstack available")
121
127
class TestGlanceMirror(TestCase):
122
128
    """Tests for GlanceMirror methods."""
123
129