Ejemplo 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)
Ejemplo n.º 2
0
def bottle_create():
    name = request.forms.get('name')
    about = request.forms.get('about')
    state = request.forms.get('state')
    global result
    result = file_server.add(name, about, state)
    if result == file_server.result_OK:
        result = 'Added successfully'
Ejemplo n.º 3
0
 def test_file_server_create(self):
     self.assertEqual(file_server.result_OK,
                      file_server.add('Lab for test'))
     self.assertEqual(file_server.error_file_exists,
                      file_server.add('Lab for test'))