These are some of the labs from Edube for their PCAP Python Certification course.
├───pcap
│ ├───2.5.1.10
│ ├───2.5.1.11
│ ├───2.5.1.6
│ ├───2.5.1.7
│ ├───2.5.1.8
│ ├───2.5.1.9
│ ├───2.8.1.4
│ └───3.2.1.14
└───pcep
└───2.6.1.11
├───pcap
| ├───lab.py
| ├───readme.md
| ├───test_lab.py
The readme.md file is a file that contains the lab instructions.
The templates folder is there to make setting up new files in each lab folder easier by following these steps:
- Copy them over to the new folder
- Rename the
lab.pyandtest_lab.pyfiles tolab_<labnumber>.pyandtest_lab_<lab-number>.py, respectively, or use another name that is unique to avoid name collisions in pytest when running all of the tests. For example in folder1.1, rename the fileslab_11.pyandtest_lab_11.py.
Open a command prompt and run these commands:
- Clone the repository:
git clone "git@github.com:ryanschostag/python-foundation-certifications.git" - Change directories:
cd python-foundation-certifications - Create virtual environment:
C:\path\to\python3.7\python.exe -m venv . - Activate virtual environment:
Scripts\activate - Install packages:
python -m pip install -r requirements.txt
Each lab and test file can be run through pytest with your preferred options.
To run a specific test module:
pytest labs\cert\1.1\test_lab_11.py
To run all the test modules:
pytest labs
Example output:
collected 38 items
labs\pcap\2.5.1.10\test_lab_25110.py .... [ 10%]
labs\pcap\2.5.1.11\test_lab_25111.py ...... [ 26%]
labs\pcap\2.5.1.6\test_lab_2516.py ....... [ 44%]
labs\pcap\2.5.1.7\test_lab_2517.py .... [ 55%]
labs\pcap\2.5.1.8\test_lab_2518.py ... [ 63%]
labs\pcap\2.5.1.9\test_lab_2519.py ....... [ 81%]
labs\pcap\3.2.1.14\test_lab_32114.py .... [ 92%]
labs\pcep\2.6.1.11\test_lab_26111.py ... [100%]
================== 38 passed in 0.13s ==================
Each lab file may have a __main__ entry point defined. If so, you can run each of these lab files with python lab.py syntax from the command prompt.
When you install package, place the package name and version in the requirements.txt file.