-
Notifications
You must be signed in to change notification settings - Fork 2
38 lines (34 loc) · 1.78 KB
/
unittest38.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: WebScripts38 Tests
on: [push]
jobs:
build:
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
name: "Run test on ${{ matrix.os }} with 3.8"
runs-on: "${{ matrix.os }}"
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Test WebScripts with unittest
run: |
mkdir WebScripts/hardening
echo "{}" > WebScripts/hardening/logs_checks.json
echo "{}" > WebScripts/hardening/uploads_file_integrity.json
echo "{}" > WebScripts/hardening/webscripts_file_integrity.json
echo "{}" > WebScripts/hardening/audit.html
echo "{}" > WebScripts/hardening/audit.txt
echo "{}" > WebScripts/hardening/audit.json
python WebScripts/scripts/to_3.8/to_3.8.py
python -c "from os import replace;from shutil import rmtree,copytree;rmtree('WebScripts');copytree('WebScripts38', 'WebScripts');replace('setup38.py', 'setup.py')"
python -m unittest discover -s test -p Test*.py -v
python -c "import json as j,os;f=os.path.join('WebScripts','config','server.json');d=j.load(open(f));d['server']['force_file_permissions']=False;j.dump(d,open(f,'w'))"
python -c "import os;f=os.path.join('WebScripts','WebScripts.py');d=open(f).read().replace('force_file_permissions = True','force_file_permissions=False');open(f,'w').write(d)"
python -m WebScripts --test-running --security
python -m pip install .
python -m pip install --force-reinstall .
python -m WebScripts.harden -o `whoami` -p 'abc' -d '.'
python setup.py install --admin-password=abc --directory=.