mirror of
https://github.com/aaPanel/aaPanel.git
synced 2026-08-17 21:25:47 +02:00
Since version 7.7.0, we recommend yours update python to 3.12. [+] Using nginx technology to load static files improves access speed [+] Refactor homepage, website, FTP, and database using vue3 [+] Table loading changed to skeleton screen [+] Add Website statistics-v2 professional plug-in [+] Add Home page - top 5 resource occupancy [+] Add protection for Files management (requires Tamper-proof for Enterprise 3.7) [+] Website, FTP, Databases page add program status [+] Add FTP log analysis (only supports Centos) [+] Add password-free login to phpMyAdmin [+] Add Proxy Project in Website (Supported when web service uses Nginx) [+] Add WP Toolkit (Pro version only) [+] Redesigned Docker module [+] Add WP Toolkit Protection [+] Add WP Toolkit Backup and Restore [+] Add WP Toolkit Migrated [+] Add WP Toolkit Clone site (supports new domain and subdomain) [+] Add WP Toolkit Create site from backup of other panel [+] Add WP Toolkit support for Cron automatic backup (only save Local disk) [+] Add WP Toolkit operation log [+] Add Integrity check for WP Toolkit [+] Add WP Toolkit plug-in management and themes management [*] Optimize phpMyAdmin formula access method [*] Optimize Home page PHP display problem [*] Optimize jump to the login interface after the login expires [*] Optimize automatic renewal of SSL at some times [*] Optimize Let's Encrypt to increase application success rate [-] Fix Logs Audit cannot be opened [-] Fix apache URL rewrite issue [-] Fix phpmyadmin installation problem [-] Fix the problem that some servers cannot install software [-] Fix upload file error [-] Fix left menu hiding problem [-] Fix aaPanel Mobile QR code display problem [-] Fix problem that third-party plug-ins are not displayed in the App Store [-] Fix issue where the menu bar is blank when opening new tabs [-] Fixed panel not being accessible in some cases [-] Fix the issue where Curl warning caused the inability to apply for SSL [-] Fix Quota issues for Website, FTP, Databases [-] Fix file interface display problem on mobile terminal
274 lines
7.8 KiB
Python
274 lines
7.8 KiB
Python
import unittest
|
|
import sys
|
|
if "/www/server/panel" not in sys.path:
|
|
sys.path.insert(0, "/www/server/panel")
|
|
from mod.base import RealProcess
|
|
|
|
if "/www/server/panel/class" not in sys.path:
|
|
sys.path.insert(0, "/www/server/panel/class")
|
|
import public
|
|
|
|
from mod.project.php.php_asyncMod import main as php_async
|
|
phpasync = php_async()
|
|
|
|
class Testmain(unittest.TestCase):
|
|
def test_create_project(self):
|
|
args = {
|
|
'webname':{"domain":"test.c","domainlist":[]},
|
|
'php_version':'74',
|
|
'site_path':'/xiaopacai/swoole-webim-demo-master',
|
|
'project_cmd':'php server/hsw_server.php start',
|
|
'install_dependence':'1',
|
|
'sql':'',
|
|
'sql_name':'',
|
|
'sql_user': '',
|
|
'sql_pwd': '',
|
|
'sql_codeing': '',
|
|
'project_ps': '',
|
|
'open_proxy': '',
|
|
'project_proxy_path': '',
|
|
'project_port': '',
|
|
}
|
|
# phpasync.create_project(public.to_dict_obj(args))
|
|
|
|
|
|
def test_delete_site(self):
|
|
args = {
|
|
'webname':"test.c",
|
|
'id':'1',
|
|
}
|
|
# phpasync.delete_site(public.to_dict_obj(args))
|
|
|
|
def test_get_project_list(self):
|
|
res = phpasync.get_project_list(public.to_dict_obj({}))
|
|
self.assertEqual(type(res), dict)
|
|
|
|
def test_project_get_domain(self):
|
|
args = {
|
|
'sitename':'sdadaw.c'
|
|
}
|
|
res = phpasync.project_get_domain(public.to_dict_obj(args))
|
|
self.assertEqual(type(res), dict)
|
|
|
|
|
|
def test_project_remove_domain(self):
|
|
self.fail()
|
|
|
|
def test_project_add_domain(self):
|
|
args = {
|
|
'sitename':'sdadaw.c',
|
|
'domain':["daw.daw","ssff.cxs"]
|
|
}
|
|
res = phpasync.project_add_domain(public.to_dict_obj(args))
|
|
self.assertEqual(type(res), dict)
|
|
def test_get_project_run_state(self):
|
|
args = {
|
|
'sitename':'sdadaw.c',
|
|
}
|
|
res = phpasync.get_project_run_state(public.to_dict_obj(args))
|
|
self.assertEqual(type(res), dict)
|
|
|
|
def test_modify_project_run_state(self):
|
|
args = {
|
|
'sitename':'sdadaw.c',
|
|
'status':'stop'
|
|
}
|
|
res = phpasync.modify_project_run_state(public.to_dict_obj(args))
|
|
self.assertEqual(type(res), dict)
|
|
|
|
def test_async_dependence_config(self):
|
|
self.fail()
|
|
|
|
def test_modify_project(self):
|
|
args = {
|
|
'sitename':'sdadaw.c',
|
|
'php_version':'74',
|
|
'project_path':'/xiaopacai/swoole-webim-demo-master',
|
|
'project_cmd':'php server/hsw_server.php start',
|
|
'site_run_path':'/xiaopacai/swoole-webim-demo-master',
|
|
'project_port': '',
|
|
}
|
|
res = phpasync.modify_project(public.to_dict_obj(args))
|
|
self.assertEqual(type(res), dict)
|
|
|
|
def test_get_project_log(self):
|
|
args = {
|
|
'sitename':'sdadaw.c',
|
|
}
|
|
res = phpasync.get_project_log(public.to_dict_obj(args))
|
|
self.assertEqual(type(res), dict)
|
|
|
|
def test_get_config_file(self):
|
|
args = {
|
|
'sitename':'sdadaw.c',
|
|
}
|
|
res = phpasync.get_config_file(public.to_dict_obj(args))
|
|
self.assertEqual(type(res), dict)
|
|
|
|
def test_upload_version(self):
|
|
self.fail()
|
|
|
|
def test_get_version_list(self):
|
|
args = {
|
|
'sitename':'sdadaw.c',
|
|
}
|
|
res = phpasync.get_version_list(public.to_dict_obj(args))
|
|
|
|
def test_remove_version(self):
|
|
args = {
|
|
'sitename':'sdadaw.c',
|
|
'version':'1'
|
|
}
|
|
res = phpasync.remove_version(public.to_dict_obj(args))
|
|
self.assertEqual(type(res), dict)
|
|
|
|
def test_recover_version(self):
|
|
args = {
|
|
'sitename':'sdadaw.c',
|
|
'version':'1'
|
|
}
|
|
res = phpasync.recover_version(public.to_dict_obj(args))
|
|
self.assertEqual(res['code'], 1)
|
|
|
|
def test_now_file_backup(self):
|
|
args = {
|
|
'sitename':'sdadaw.c',
|
|
'version':'2'
|
|
}
|
|
res = phpasync.now_file_backup(public.to_dict_obj(args))
|
|
self.assertEqual(res['code'], 1)
|
|
|
|
def test_set_version_ps(self):
|
|
args = {
|
|
'sitename':'sdadaw.c',
|
|
'version':'2',
|
|
'ps':'test'
|
|
}
|
|
res = phpasync.set_version_ps(public.to_dict_obj(args))
|
|
self.assertEqual(res['code'], 1)
|
|
|
|
def test_get_setup_log(self):
|
|
args = {
|
|
'sitename':'sdadaw.c',
|
|
}
|
|
res = phpasync.get_setup_log(public.to_dict_obj(args))
|
|
self.assertEqual(type(res), dict)
|
|
|
|
def test_add_crontab(self):
|
|
pass
|
|
|
|
def test_get_crontab_list(self):
|
|
args = {
|
|
'sitename':'sdadaw.c',
|
|
}
|
|
res = phpasync.get_crontab_list(public.to_dict_obj(args))
|
|
self.assertEqual(res['code'], 1)
|
|
|
|
def test_start_task(self):
|
|
args = {
|
|
'id':'19',
|
|
}
|
|
res = phpasync.start_task(public.to_dict_obj(args))
|
|
self.assertEqual(res['code'], 1)
|
|
|
|
def test_modify_crontab_status(self):
|
|
args = {
|
|
'id':'19',
|
|
}
|
|
res = phpasync.modify_crontab_status(public.to_dict_obj(args))
|
|
self.assertEqual(res['code'], 1)
|
|
|
|
def test_remove_crontab(self):
|
|
args = {
|
|
'id':'19',
|
|
}
|
|
res = phpasync.remove_crontab(public.to_dict_obj(args))
|
|
self.assertEqual(res['code'], 1)
|
|
|
|
def test_modify_crontab(self):
|
|
pass
|
|
|
|
def test_get_crontab_log(self):
|
|
args = {
|
|
'id':'19',
|
|
}
|
|
res = phpasync.get_crontab_log(public.to_dict_obj(args))
|
|
self.assertEqual(res['code'], 1)
|
|
|
|
def test_clearn_logs(self):
|
|
args = {
|
|
'id':'19',
|
|
}
|
|
res = phpasync.clearn_logs(public.to_dict_obj(args))
|
|
self.assertEqual(res['code'], 1)
|
|
|
|
def test_get_group_list(self):
|
|
res = phpasync.get_group_list(public.to_dict_obj('{}'))
|
|
self.assertEqual(res['code'], 1)
|
|
|
|
def test_create_group(self):
|
|
args = {
|
|
'group_name':'test',
|
|
}
|
|
res = phpasync.create_group(public.to_dict_obj(args))
|
|
self.assertEqual(res['code'], 1)
|
|
|
|
def test_remove_group(self):
|
|
args = {
|
|
'group_name':'test',
|
|
}
|
|
res = phpasync.remove_group(public.to_dict_obj(args))
|
|
self.assertEqual(res['code'], 1)
|
|
|
|
def test_group_add_project(self):
|
|
args = {
|
|
'group_name':'test',
|
|
'project_name':'sdadaw.c'
|
|
}
|
|
res = phpasync.group_add_project(public.to_dict_obj(args))
|
|
self.assertEqual(res['code'], 1)
|
|
|
|
def test_group_remove_project(self):
|
|
args = {
|
|
'group_name':'test',
|
|
'project_name':'sdadaw.c'
|
|
}
|
|
res = phpasync.group_remove_project(public.to_dict_obj(args))
|
|
self.assertEqual(res['code'], 1)
|
|
|
|
def test_set_group_interval(self):
|
|
args = {
|
|
'group_name':'test',
|
|
'interval':'15'
|
|
}
|
|
res = phpasync.set_group_interval(public.to_dict_obj(args))
|
|
self.assertEqual(res['code'], 1)
|
|
|
|
def test_set_group_status(self):
|
|
args = {
|
|
'group_name':'test',
|
|
'status':'1'
|
|
}
|
|
res = phpasync.set_group_status(public.to_dict_obj(args))
|
|
self.assertEqual(res['code'], 1)
|
|
|
|
def test_get_proxy_file(self):
|
|
args = {
|
|
'sitename':'sdadaw.c',
|
|
'proxyname':'test'
|
|
}
|
|
res = phpasync.get_proxy_file(public.to_dict_obj(args))
|
|
self.assertEqual(res['code'], 1)
|
|
|
|
def test_save_proxy_file(self):
|
|
args = {
|
|
'sitename':'sdadaw.c',
|
|
'proxyname':'test',
|
|
'file':'test'
|
|
}
|
|
res = phpasync.save_proxy_file(public.to_dict_obj(args))
|
|
self.assertEqual(res['code'], 1)
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|