# Path: tests/context.py



from contextlib import contextmanager
from .context import pydatajson
import unittest
import nose
import os
import vcr
import tempfile
import shutil




SAMPLES_DIR = os.path.join("tests", "samples")
RESULTS_DIR = os.path.join("tests", "results")

VCR = vcr.VCR(path_transformer=vcr.VCR.ensure_suffix('.yaml'),
              cassette_library_dir=os.path.join("tests", "cassetes", "backup"),
              record_mode='once')


@contextmanager
def tempdir(cleanup=True):
    tmp = tempfile.mkdtemp(dir='tests/temp')
    try:
        yield tmp
    finally:
        cleanup and shutil.rmtree(tmp, ignore_errors=True)


class BackupTestCase(unittest.TestCase):
    """Tests for backup methods."""

    @classmethod
    def get_sample(cls, sample_filename):
        return os.path.join(SAMPLES_DIR, sample_filename)

    @classmethod
    def setUp(cls):

# Path: tests/context.py



# Path: tests/test_backup.py
from contextlib import contextmanager
from .context import pydatajson
import unittest
import nose
import os
import vcr
import tempfile
import shutil





SAMPLES_DIR = os.path.join("tests", "samples")
RESULTS_DIR = os.path.join("tests", "results")

VCR = vcr.VCR(path_transformer=vcr.VCR.ensure_suffix('.yaml'),
              cassette_library_dir=os.path.join("tests", "cassetes", "backup"),
              record_mode='once')


@contextmanager
def tempdir(cleanup=True):
    tmp = tempfile.mkdtemp(dir='tests/temp')
    try:
        yield tmp
    finally:
        cleanup and shutil.rmtree(tmp, ignore_errors=True)


class BackupTestCase(unittest.TestCase):
    """Tests for backup methods."""

    @classmethod
    def get_sample(cls, sample_filename):
        return os.path.join(SAMPLES_DIR, sample_filename)

    @classmethod
    def setUp(cls):

        cls.catalog_meta = pydatajson.DataJson(