~ubuntu-branches/ubuntu/wily/simplestreams/wily

« back to all changes in this revision

Viewing changes to tests/testutil.py

  • Committer: Package Import Robot
  • Author(s): Scott Moser
  • Date: 2013-03-26 01:10:01 UTC
  • Revision ID: package-import@ubuntu.com-20130326011001-342bcgb65worw4r8
Tags: upstream-0.1.0~bzr191
ImportĀ upstreamĀ versionĀ 0.1.0~bzr191

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import os
 
2
from simplestreams import objectstores
 
3
from simplestreams import mirrors
 
4
 
 
5
 
 
6
EXAMPLES_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__),
 
7
                                            "..", "examples"))
 
8
 
 
9
def get_mirror_reader(name, docdir=None):
 
10
    if docdir is None:
 
11
        docdir = EXAMPLES_DIR
 
12
 
 
13
    src_d = os.path.join(EXAMPLES_DIR, name)
 
14
    sstore = objectstores.FileStore(src_d)
 
15
    return mirrors.ObjectStoreMirrorReader(sstore)
 
16
 
 
17
# vi: ts=4 expandtab syntax=python