예제 #1
0
    def setUp(self):
        import testbundle.bundle
        self.bundle_dir = os.path.dirname(testbundle.bundle.__file__)
        self.rc = get_runconfig(
            (os.path.join(self.bundle_dir, 'client-test-config.yaml'),
             os.path.join(self.bundle_dir,
                          'bundle.yaml'), RunConfig.USER_CONFIG))

        self.copy_or_build_bundle()

        self.bundle = Bundle()
예제 #2
0
    def setUp(self):

        import shutil, os

        self.copy_or_build_bundle()
        self.bundle_dir = os.path.join(
            os.path.dirname(os.path.abspath(__file__)), '../testbundle')

        self.bundle = Bundle()
        self.bundle_dir = self.bundle.bundle_dir

        self.server_rc = RunConfig(
            [os.path.join(self.bundle_dir, 'server-test-config.yaml')])
        self.client_rc = RunConfig(
            [os.path.join(self.bundle_dir, 'client-test-config.yaml')])

        root = os.path.join(self.client_rc.filesystem.root_dir, 'test')

        shutil.rmtree(root)
예제 #3
0
    def setUp(self):
        import testbundle.bundle, shutil, os

        self.bundle_dir = os.path.dirname(testbundle.bundle.__file__)
        self.rc = get_runconfig(
            (os.path.join(self.bundle_dir, 'source-test-config.yaml'),
             os.path.join(self.bundle_dir,
                          'bundle.yaml'), RunConfig.USER_ACCOUNTS))

        self.copy_or_build_bundle()

        bundle = Bundle()

        self.source_save_dir = str(
            self.rc.group('filesystem').root) + '-source'

        self.setup_source_dir()

        print "Deleting: {}".format(self.rc.group('filesystem').root)
        ambry.util.rm_rf(self.rc.group('filesystem').root)

        bdir = os.path.join(self.rc.sourcerepo.dir, 'testbundle')

        pats = shutil.ignore_patterns('build', 'build-save', '*.pyc', '.git',
                                      '.gitignore', '.ignore', '__init__.py')

        print "Copying test dir tree to ", bdir
        shutil.copytree(bundle.bundle_dir, bdir, ignore=pats)

        # Import the bundle file from the directory
        from ambry.run import import_file
        import imp

        rp = os.path.realpath(os.path.join(bdir, 'bundle.py'))
        mod = import_file(rp)

        dir_ = os.path.dirname(rp)
        self.bundle = mod.Bundle(dir_)

        print self.bundle.bundle_dir
예제 #4
0
파일: test_ckan.py 프로젝트: Gudinya/ambry
    def setUp(self):

        self.copy_or_build_bundle()

        self.bundle = Bundle()    
        self.bundle_dir = self.bundle.bundle_dir