Skip to content

ryanschostag/python-foundation-certifications

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Foundation Certifications

These are some of the labs from Edube for their PCAP Python Certification course.

Directory Structure

labs

├───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

templates

├───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:

  1. Copy them over to the new folder
  2. Rename the lab.py and test_lab.py files to lab_<labnumber>.py and test_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 folder 1.1, rename the files lab_11.py and test_lab_11.py.

Setup

Open a command prompt and run these commands:

  1. Clone the repository: git clone "git@github.com:ryanschostag/python-foundation-certifications.git"
  2. Change directories: cd python-foundation-certifications
  3. Create virtual environment: C:\path\to\python3.7\python.exe -m venv .
  4. Activate virtual environment: Scripts\activate
  5. Install packages: python -m pip install -r requirements.txt

Usage

Each lab and test file can be run through pytest with your preferred options.

pytest examples

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 ==================

Manual testing

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.

Adding packages

When you install package, place the package name and version in the requirements.txt file.

About

Edube PCAP Labs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages