Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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(), [])
Ejemplo n.º 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(), [])
Ejemplo n.º 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()))
Ejemplo n.º 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()))
Ejemplo n.º 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)
Ejemplo n.º 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)