# Path: wsgidav/prop_man/property_manager.py
# class PropertyManager:
# class ShelvePropertyManager(PropertyManager):
#     def __init__(self):
#     def __repr__(self):
#     def __del__(self):
#     def _lazy_open(self):
#     def _sync(self):
#     def _close(self):
#     def _check(self, msg=""):
#     def _dump(self, msg=""):
#     def get_properties(self, norm_url, environ=None):
#     def get_property(self, norm_url, name, environ=None):
#     def write_property(
#         self, norm_url, name, property_value, dry_run=False, environ=None
#     ):
#     def remove_property(self, norm_url, name, dry_run=False, environ=None):
#     def remove_properties(self, norm_url, environ=None):
#     def copy_properties(self, src_url, dest_url, environ=None):
#     def move_properties(self, src_url, dest_url, with_children, environ=None):
#     def __init__(self, storage_path):
#     def __repr__(self):
#     def _lazy_open(self):
#     def _sync(self):
#     def _close(self):
#     def clear(self):


import os
import sys
import unittest
from tempfile import gettempdir
from wsgidav.prop_man import property_manager
        )

        assert pm._dict is None, "No properties should have been created by this test"

    def testReadWrite(self):
        """Property manager should raise errors on bad args."""
        pm = self.pm
        url = "/dav/res"
        pm.write_property(url, "foo", "my name is joe")
        assert pm.get_property(url, "foo") == "my name is joe"


# ========================================================================
# ShelveTest
# ========================================================================
class ShelveTest(BasicTest):
    """Test property_manager.ShelvePropertyManager()."""

    def setUp(self):
        if sys.version_info < (3, 0):
            modifier = "-py2"  # shelve formats are incompatible
        else:
            modifier = "-py3"
        self.path = os.path.join(
            gettempdir(), "wsgidav-props{}.shelve".format(modifier)
        )
        # Note: os.remove(self.path) does not work, because Shelve may append
        # a file extension.
        #        if os.path.exists(self.path):
        #            os.remove(self.path)

# Path: wsgidav/prop_man/property_manager.py
# class PropertyManager:
# class ShelvePropertyManager(PropertyManager):
#     def __init__(self):
#     def __repr__(self):
#     def __del__(self):
#     def _lazy_open(self):
#     def _sync(self):
#     def _close(self):
#     def _check(self, msg=""):
#     def _dump(self, msg=""):
#     def get_properties(self, norm_url, environ=None):
#     def get_property(self, norm_url, name, environ=None):
#     def write_property(
#         self, norm_url, name, property_value, dry_run=False, environ=None
#     ):
#     def remove_property(self, norm_url, name, dry_run=False, environ=None):
#     def remove_properties(self, norm_url, environ=None):
#     def copy_properties(self, src_url, dest_url, environ=None):
#     def move_properties(self, src_url, dest_url, with_children, environ=None):
#     def __init__(self, storage_path):
#     def __repr__(self):
#     def _lazy_open(self):
#     def _sync(self):
#     def _close(self):
#     def clear(self):


# Path: tests/test_property_manager.py
import os
import sys
import unittest
from tempfile import gettempdir
from wsgidav.prop_man import property_manager

        )

        assert pm._dict is None, "No properties should have been created by this test"

    def testReadWrite(self):
        """Property manager should raise errors on bad args."""
        pm = self.pm
        url = "/dav/res"
        pm.write_property(url, "foo", "my name is joe")
        assert pm.get_property(url, "foo") == "my name is joe"


# ========================================================================
# ShelveTest
# ========================================================================
class ShelveTest(BasicTest):
    """Test property_manager.ShelvePropertyManager()."""

    def setUp(self):
        if sys.version_info < (3, 0):
            modifier = "-py2"  # shelve formats are incompatible
        else:
            modifier = "-py3"
        self.path = os.path.join(
            gettempdir(), "wsgidav-props{}.shelve".format(modifier)
        )
        # Note: os.remove(self.path) does not work, because Shelve may append
        # a file extension.
        #        if os.path.exists(self.path):
        #            os.remove(self.path)

        self.pm = property_manager.ShelvePropertyManager(self.path)