示例#1
0
    def test_delete_on_existent_file(self):
        self.fakeFile = self.get_dummy_file()
        realpath = os.path.join(GLSettings.static_path, self.fakeFile['name'])
        dumped_file = yield write_upload_plaintext_to_disk(self.fakeFile, realpath)

        handler = self.request({}, role='admin')
        yield handler.delete(self.fakeFile['name'])
示例#2
0
    def test_delete_on_existent_file(self):
        self.fakeFile = self.get_dummy_file()
        realpath = os.path.join(GLSettings.static_path, self.fakeFile['name'])
        yield write_upload_plaintext_to_disk(self.fakeFile, realpath)

        handler = self.request({}, role='admin')
        yield handler.delete(self.fakeFile['name'])
示例#3
0
    def test_get_list_of_files(self):
        self.fakeFile = self.get_dummy_file()
        realpath = os.path.join(GLSettings.static_path, self.fakeFile['name'])
        yield write_upload_plaintext_to_disk(self.fakeFile, realpath)

        handler = self.request(role='admin')
        response = yield handler.get()

        found = False
        for f in response:
            if f['name'] == self.fakeFile['name']:
                found = True
                break

        self.assertTrue(found)
示例#4
0
    def test_get_list_of_files(self):
        self.fakeFile = self.get_dummy_file()
        realpath = os.path.join(GLSettings.static_path, self.fakeFile['name'])
        dumped_file = yield write_upload_plaintext_to_disk(self.fakeFile, realpath)

        handler = self.request(role='admin')
        yield handler.get()
        self.assertTrue(isinstance(self.responses[0], list))

        found = False

        for f in self.responses[0]:
            if f['name'] == self.fakeFile['name']:
                found = True
                break

        self.assertTrue(found)