def testFindFileNames(self): filename = "dummy" helper = TableFileHelper(filename, TEST_DIR) helper.create() python_files = self.generator._findFilenames( \ self.generator._user_directory) self.assertTrue(python_files.index(filename) > -1) helper.destroy()
def testTableSave(self): if IGNORE_TEST: return filename = "dummy" _ = self._createBaseTable() helper = TableFileHelper(filename, st.SCISHEETS_USER_TBLDIR) helper.create() self._tableSave(filename) helper.destroy()
def testTableOpenTableFiles(self): if IGNORE_TEST: return filename = "dummy" helper = TableFileHelper(filename, st.SCISHEETS_USER_TBLDIR) helper.create() ajax_cmd = self._ajaxCommandFactory() ajax_cmd['target'] = 'Table' ajax_cmd['command'] = 'OpenTableFile' ajax_cmd['args[]'] = filename command_url = self._createURLFromAjaxCommand(ajax_cmd, address=BASE_URL) response = self.client.get(command_url) content = json.loads(response.content) self.assertTrue("success" in content) self.assertTrue(content["success"]) helper.destroy()
def testTableDelete(self): if IGNORE_TEST: return filename = "dummy" helper = TableFileHelper(filename, st.SCISHEETS_USER_TBLDIR) _ = self._createBaseTable() helper.create() self._tableSave(filename) ajax_cmd = self._ajaxCommandFactory() ajax_cmd['target'] = 'Table' ajax_cmd['command'] = 'Delete' command_url = self._createURLFromAjaxCommand(ajax_cmd, address=BASE_URL) response = self.client.get(command_url) content = json.loads(response.content) self.assertTrue("success" in content) self.assertTrue(content["success"]) self.assertTrue(TableFileHelper.doesFilepathExist( st.SCISHEETS_DEFAULT_TABLEFILE))
def testTableDelete(self): if IGNORE_TEST: return filename = "dummy" helper = TableFileHelper(filename, st.SCISHEETS_USER_TBLDIR) _ = self._createBaseTable() helper.create() self._tableSave(filename) ajax_cmd = self._helper_http.ajaxCommandFactory() ajax_cmd['target'] = 'Sheet' ajax_cmd['command'] = 'Delete' command_url = self._helper_http.createURLFromAjaxCommand( ajax_cmd, address=BASE_URL) response = self.client.get(command_url) content = json.loads(response.content) self.assertTrue("success" in content) self.assertTrue(content["success"]) self.assertTrue( TableFileHelper.doesFilepathExist(st.SCISHEETS_DEFAULT_TABLEFILE))
def testTableNew(self): if IGNORE_TEST: return filename = st.SCISHEETS_DEFAULT_TABLEFILE _ = self._createBaseTable() ajax_cmd = self._ajaxCommandFactory() ajax_cmd['target'] = 'Table' ajax_cmd['command'] = 'New' command_url = self._createURLFromAjaxCommand(ajax_cmd, address=BASE_URL) response = self.client.get(command_url) content = json.loads(response.content) self.assertTrue("success" in content) self.assertTrue(content["success"]) self.assertTrue(TableFileHelper.doesFilepathExist( st.SCISHEETS_DEFAULT_TABLEFILE))
def testTableOpenSheetFiles(self): if IGNORE_TEST: return filename = "dummy" helper = TableFileHelper(filename, st.SCISHEETS_USER_TBLDIR) helper.create() ajax_cmd = self._helper_http.ajaxCommandFactory() ajax_cmd['target'] = 'Sheet' ajax_cmd['command'] = 'OpenSheetFile' ajax_cmd['args[]'] = filename command_url = self._helper_http.createURLFromAjaxCommand( ajax_cmd, address=BASE_URL) response = self.client.get(command_url) content = json.loads(response.content) self.assertTrue("success" in content) self.assertTrue(content["success"]) helper.destroy()