Esempio n. 1
0
 def test_file_server_update(self):
     name1 = 'Some lab for test'
     name2 = 'Some lab for test 2'
     file_server.add(name1)
     file_server.add(name2)
     self.assertEqual(file_server.result_OK,
                      file_server.update(name1, 'about', 'About something'))
     self.assertEqual(file_server.error_file_exists,
                      file_server.update(name1, 'name', name2))
     file_server.delete(name1)
     file_server.delete(name2)
Esempio n. 2
0
 def test_file_server_delete(self):
     self.assertEquals(file_server.result_OK,
                       file_server.delete('Lab for test'))
     self.assertEquals(file_server.error_no_file,
                       file_server.delete('Lab for test'))
Esempio n. 3
0
def bottle_delete():
    global result
    result = file_server.delete(request.body.read())
    if result == file_server.result_OK:
        result = 'Deleted successfully'