def test_delete_notfound(self):
        from plone.resourceeditor.browser import FileManager
        r = self._make_directory()

        view = FileManager(r, self.layer['request'])

        info = view.delete('/test.txt')

        self.assertEqual(info['code'], 1)
        self.assertNotEqual(info['error'], '')
        self.assertEqual(info['path'], '/test.txt')
Esempio n. 2
0
    def test_delete_notfound(self):
        from plone.resourceeditor.browser import FileManager
        r = self._make_directory()

        view = FileManager(r, self.layer['request'])

        info = view.delete('/test.txt')

        self.assertEqual(info['code'], 1)
        self.assertNotEqual(info['error'], '')
        self.assertEqual(info['path'], '/test.txt')
Esempio n. 3
0
    def test_delete_notfound(self):
        from plone.resourceeditor.browser import FileManager

        r = self._make_directory()

        view = FileManager(r, self.layer["request"])

        info = view.delete("/test.txt")

        self.assertEqual(info["code"], 1)
        self.assertNotEqual(info["error"], "")
        self.assertEqual(info["path"], "/test.txt")
    def test_delete(self):
        from plone.resourceeditor.browser import FileManager
        r = self._make_directory()
        r.writeFile('test.txt', b'foo')

        view = FileManager(r, self.layer['request'])

        info = view.delete('/test.txt')

        self.assertEqual(info['code'], 0)
        self.assertEqual(info['error'], '')
        self.assertEqual(info['path'], '/test.txt')

        self.assertFalse('test.txt' in r)
Esempio n. 5
0
    def test_delete(self):
        from plone.resourceeditor.browser import FileManager
        r = self._make_directory()
        r.writeFile('test.txt', 'foo')

        view = FileManager(r, self.layer['request'])

        info = view.delete('/test.txt')

        self.assertEqual(info['code'], 0)
        self.assertEqual(info['error'], '')
        self.assertEqual(info['path'], '/test.txt')

        self.assertFalse('test.txt' in r)
Esempio n. 6
0
    def test_delete(self):
        from plone.resourceeditor.browser import FileManager

        r = self._make_directory()
        r.writeFile("test.txt", "foo")

        view = FileManager(r, self.layer["request"])

        info = view.delete("/test.txt")

        self.assertEqual(info["code"], 0)
        self.assertEqual(info["error"], "")
        self.assertEqual(info["path"], "/test.txt")

        self.assertFalse("test.txt" in r)
Esempio n. 7
0
    def test_delete_subfolder(self):
        from plone.resourceeditor.browser import FileManager
        r = self._make_directory()
        r.makeDirectory('alpha')
        r['alpha'].writeFile("test.txt", "foo")

        view = FileManager(r, self.layer['request'])

        info = view.delete("/alpha/test.txt")

        self.assertEqual(info['code'], 0)
        self.assertEqual(info['error'], '')
        self.assertEqual(info['path'], '/alpha/test.txt')

        self.assertFalse('test.txt' in r['alpha'])