示例#1
0
 def setUp(self):
     """
     Create a resource and a xattr property store for it.
     """
     self.resourcePath = FilePath(self.mktemp())
     self.resourcePath.setContent("")
     self.attrs = xattr(self.resourcePath.path)
     self.resource = DAVFile(self.resourcePath.path)
     self.propertyStore = xattrPropertyStore(self.resource)
示例#2
0
 def setUp(self):
     """
     Create a resource and a xattr property store for it.
     """
     self.resourcePath = FilePath(self.mktemp())
     self.resourcePath.setContent("")
     self.attrs = xattr(self.resourcePath.path)
     self.resource = DAVFile(self.resourcePath.path)
     self.propertyStore = xattrPropertyStore(self.resource)
示例#3
0
    def test_listMissing(self):
        """
        Test missing file.
        """

        resourcePath = FilePath(self.mktemp())
        resource = DAVFile(resourcePath.path)
        propertyStore = xattrPropertyStore(resource)

        # Try to get a property from it - and fail.
        self.assertEqual(propertyStore.list(), [])
示例#4
0
    def test_listMissing(self):
        """
        Test missing file.
        """

        resourcePath = FilePath(self.mktemp())
        resource = DAVFile(resourcePath.path)
        propertyStore = xattrPropertyStore(resource)

        # Try to get a property from it - and fail.
        self.assertEqual(propertyStore.list(), [])
示例#5
0
    def test_containsMissing(self):
        """
        Test missing file.
        """

        resourcePath = FilePath(self.mktemp())
        resource = DAVFile(resourcePath.path)
        propertyStore = xattrPropertyStore(resource)

        # Try to get a property from it - and fail.
        document = self._makeValue()
        self.assertFalse(propertyStore.contains(document.root_element.qname()))
示例#6
0
    def test_containsMissing(self):
        """
        Test missing file.
        """

        resourcePath = FilePath(self.mktemp())
        resource = DAVFile(resourcePath.path)
        propertyStore = xattrPropertyStore(resource)

        # Try to get a property from it - and fail.
        document = self._makeValue()
        self.assertFalse(propertyStore.contains(document.root_element.qname()))
示例#7
0
    def test_getMissing(self):
        """
        Test missing file.
        """

        resourcePath = FilePath(self.mktemp())
        resource = DAVFile(resourcePath.path)
        propertyStore = xattrPropertyStore(resource)

        # Try to get a property from it - and fail.
        document = self._makeValue()
        error = self.assertRaises(HTTPError, propertyStore.get,
                                  document.root_element.qname())

        # Make sure that the status is NOT FOUND.
        self.assertEquals(error.response.code, NOT_FOUND)
示例#8
0
    def test_getMissing(self):
        """
        Test missing file.
        """

        resourcePath = FilePath(self.mktemp())
        resource = DAVFile(resourcePath.path)
        propertyStore = xattrPropertyStore(resource)

        # Try to get a property from it - and fail.
        document = self._makeValue()
        error = self.assertRaises(
            HTTPError,
            propertyStore.get,
            document.root_element.qname())

        # Make sure that the status is NOT FOUND.
        self.assertEquals(error.response.code, NOT_FOUND)