Commit 42431df3 authored by Samuel GAIST's avatar Samuel GAIST

[tests] Generate a temporary test prefix

This will rsync prefixes of all needed packages in one place in
order to provide a single prefix like on development or production

This will allow the removal of the use of the Prefix class that was
mainly use only in tests.
parent edf5512a
......@@ -28,10 +28,15 @@
# Basic setup for command test
import os
import sys
import tempfile
import shutil
import subprocess
import pkg_resources
import six.moves.urllib as urllib
from beat.core.test import prefix, tmp_prefix, teardown_package
from beat.core.test import tmp_prefix, teardown_package
platform = os.environ.get('BEAT_CMDLINE_TEST_PLATFORM', '')
......@@ -65,3 +70,29 @@ else:
user = 'user'
token = '4'
if sys.platform == 'darwin':
tmp_folder = tempfile.mkdtemp(prefix=__name__, suffix='.tmpdir', dir='/tmp')
tmp_folder = tempfile.mkdtemp(prefix=__name__, suffix='.tmpdir')
prefix = os.path.join(tmp_folder, 'prefix')
def rsync_to_tmp(path):
subprocess.check_call(['rsync', '-arz', path, tmp_folder])
def setup_package():
prefixes = [
pkg_resources.resource_filename('beat.backend.python.test', 'prefix'),
pkg_resources.resource_filename('beat.core.test', 'prefix')
for path in prefixes:
def teardown_package():
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment