Skip to content

jessevogt/mke-python-demo-get-my-ip

Repository files navigation

Build Status

Lightning Talk: Testing & CI

Jesse Vogt, jessevogt.com

Demo Project

github.com/jessevogt/mke-python-demo-get-my-ip

  • get my public ip address by checking against a number of public services
  • services.py
    • holds endpoint url
    • can make request through a provided ClientSession
    • can extract ip address from service response
    • services.txt - list of APIs to query. Format:
     <endpoint> <optional type (text|json), default=text> <args>
    
  • getmyip.py
    • main entry point
    • requests my ip from each defined service
    • return ip address if they all give back same, otherwise except

Needs tests!

test_getmyip.py

  • test text service
  • test json service
  • test different ip addresses returned

services.py

  • parse_service

Continuous Integration

  • Docker
  • TravisCI
sudo: required
services:
    - docker
before_install:
    - docker build -t jessevogt/get-my-ip:$TRAVIS_COMMIT .
script:
    - docker run --rm jessevogt/get-my-ip:$TRAVIS_COMMIT pytest

References for TravisCI

About

MKE Python Lightning Talk: Testing & CI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages