예제 #1
0
def create_shipit_commit(fbsource, shipit_projects, output_dir):
    abs_output_dir = os.path.join(fbsource.path, output_dir)
    with make_temp_dir(abs_output_dir):
        for project in shipit_projects:
            project_output_dir = os.path.join(abs_output_dir, project)
            run_shipit(fbsource.path, project, project_output_dir)

        with commit_to_hg(fbsource, output_dir, 'ShipIt-processed projects'):
            bundle_info = get_local_repo_everstore_bundle_lego_dict(fbsource)

    return bundle_info
예제 #2
0
 def setUp(self):
     # Create test directory
     self.dir_ = utils.make_temp_dir()
     # Make files and symlinks for tests
     #
     # File to link to 'test.txt'
     self.filen = utils.make_file('test.txt',dirn=self.dir_)
     # Absolute and relative links to this file
     self.abslink = utils.make_symlink('abslink',self.filen,dirn=self.dir_)
     self.rellink = utils.make_symlink('rellink',os.path.basename(self.filen),
                                       dirn=self.dir_)
     # A broken link (relative)
     self.brklink = utils.make_symlink('brklink','missing.txt',
                                       dirn=self.dir_)
     # A bzipped file and a broken link that points to the uncompressed
     # file name (an example of an "alternative target")
     self.bzfilen = utils.make_file('test2.txt.bz2',dirn=self.dir_,
                                    compress='bz2')
     self.altlink = utils.make_symlink('altlink','test2.txt',dirn=self.dir_)
     # A link that points outside of the temp dir (broken)
     extfilen = os.path.normpath(os.path.join(self.dir_,'..','elsewhere','test3.txt'))
     self.extlink = utils.make_symlink('extlink',extfilen,dirn=self.dir_)
예제 #3
0
 def setUp(self):
     # Create test directory
     self.dir_ = utils.make_temp_dir()
     # Add some files, directories and links
     self.example_dir = utils.make_subdir(self.dir_,'example')
     # Primary data that looks like SOLiD
     d = utils.make_subdir(self.example_dir,'primary_data')
     utils.make_file('test1.csfasta',dirn=d)
     utils.make_file('test1_QV.qual',dirn=d)
     utils.make_file('test2.csfasta',dirn=d)
     utils.make_file('test2_QV.qual',dirn=d)
     self.primary_data_dir = d
     # Analysis with links to primary data
     d = utils.make_subdir(self.example_dir,'analysis')
     utils.make_symlink('test1.csfasta','../primary_data/test1.csfasta',dirn=d)
     utils.make_symlink('test1_QV.qual','../primary_data/test1_QV.qual',dirn=d)
     utils.make_symlink('test2.csfasta','../primary_data/test2.csfasta',dirn=d)
     utils.make_symlink('test2_QV.qual','../primary_data/test2_QV.qual',dirn=d)
     utils.make_file('test1.fastq',dirn=d)
     utils.make_file('test2.fastq',dirn=d)
     utils.make_file('test1_analysis.bam.bz2',dirn=d,compress='bz2')
     utils.make_file('test2_analysis.bam.bz2',dirn=d,compress='bz2')
     utils.make_file('organism.gff3',dirn=d)
     self.analysis_dir = d
예제 #4
0
 def setUp(self):
     # Create test directory
     self.dir_ = utils.make_temp_dir()
예제 #5
0
# -*- coding: utf-8 -*-

from time import time
import pytest

from land.copernicus.content.content.landfile import LandFileStore
from land.copernicus.content.content.api import LandFileApi

from utils import make_temp_dir
from utils import add_testfile
from utils import rm_testfile

make_temp_dir()


def test_api_add():
    store = LandFileStore()
    api = LandFileApi(store)

    landfile = api.add(title=u'A title',
                       shortname='a-title',
                       description='desc')

    assert landfile.title == u'A title'
    assert landfile.shortname == 'a-title'

    by_title = api.get('A title')
    by_shortname = api.get_by_shortname('a-title')
    by_prop = next(api.get_by_prop('description', 'desc'))

    assert by_title is not None
예제 #6
0
from StringIO import StringIO

import pytest

from plone.i18n.normalizer.tests import base as i18n_base

from land.copernicus.content.browser.views import AdminLandFilesView
from land.copernicus.content.content.landfile import LandFileStore
from land.copernicus.content.content.api import LandFileApi

from utils import make_temp_dir
from utils import add_testfile
from utils import rm_testfile


make_temp_dir()


class Context(object):
    landfiles = None

    def __init__(self):
        self.landfiles = LandFileStore()
        self.fileCategories = ['Type', 'Country']


class Request(object):
    form = None

    def __init__(self, form):
        self.form = form