# Path: tests/resources.py
# def _close(path):
# def prep_manager(mgr_name, table_name='my-new-data-table'):


import os
import pytest
    import xarray as xr
    import pandas as pd
    import numpy as np
from tests.resources import has_special_dependencies

    def test_versioned_metadata_open(self, api, opener, tempdir):

        fp = os.path.join(tempdir, "test.txt")

        var = api.create('my_archive')
        with open(fp, 'w+') as f:
            f.write(u'test test, this is a test')

        var.update(
            fp,
            bumpversion='patch',
            dependencies={'arch1': '0.1.0', 'arch2': '0.2.0'})

        with opener(var, 'r') as f:
            assert f.read() == 'test test, this is a test'

        assert len(var.get_dependencies()) == 2

        with opener(var, 'w+', dependencies={'arch2': '0.1.2'}) as f:
            f.write(u'test and more test')

        with opener(var, 'r', version='latest') as f:
            assert f.read() == 'test and more test'

        assert var.get_dependencies(version='latest')['arch2'] == '0.1.2'

        assert len(var.get_dependencies(version='0.0.1')) == 2

    @pytest.mark.skipif(

# Path: tests/resources.py
# def _close(path):
# def prep_manager(mgr_name, table_name='my-new-data-table'):


# Path: tests/test_version_metadata.py
import os
import pytest
    import xarray as xr
    import pandas as pd
    import numpy as np
from tests.resources import has_special_dependencies


    def test_versioned_metadata_open(self, api, opener, tempdir):

        fp = os.path.join(tempdir, "test.txt")

        var = api.create('my_archive')
        with open(fp, 'w+') as f:
            f.write(u'test test, this is a test')

        var.update(
            fp,
            bumpversion='patch',
            dependencies={'arch1': '0.1.0', 'arch2': '0.2.0'})

        with opener(var, 'r') as f:
            assert f.read() == 'test test, this is a test'

        assert len(var.get_dependencies()) == 2

        with opener(var, 'w+', dependencies={'arch2': '0.1.2'}) as f:
            f.write(u'test and more test')

        with opener(var, 'r', version='latest') as f:
            assert f.read() == 'test and more test'

        assert var.get_dependencies(version='latest')['arch2'] == '0.1.2'

        assert len(var.get_dependencies(version='0.0.1')) == 2

    @pytest.mark.skipif(

        not has_special_dependencies,