/tutorial

tutorials for tech

Primary LanguagePython

Tutorials

Git

Download Git

Online interactive git tutorial: Try git

Codecademy git course: https://www.codecademy.com/learn/learn-git

Git tutorial:

Config username and email before commit: https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup

$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com

Fiddler

Download Fiddler

Youtube fiddler tutorial

Capture mobile web traffic with fiddler

Charles proxy

Download Charles

iOS devices SSL Certificates configuration: official doc

  • Set your iOS device to use Charles as its HTTP proxy in the Settings app > Wifi settings.

  • Open Safari and browse to https://chls.pro/ssl. Safari will prompt you to install the SSL certificate.

  • If you are on iOS 10.3 or later, open the Settings.app and navigate to General > About > Certificate Trust

Settings, and find the Charles Proxy certificate, and switch it on to enable full trust for it.

Charles tutorial: https://www.raywenderlich.com/154244/charles-proxy-tutorial-ios

Selenium

Appium

python Unittest & pytest

Design test framework and cases  
Data driven test case  

Unittest

  • Create python unittest in pycharm

  • Create run configuration as Python tests --> Uniitests

  • Select Target as Path and specify a folder if run all tests

  • Or Select Python if run specific test

  • e.g:<test_file_name>.<test_class_name>.[<test_method>]

  • Unittest supports simple test discovery. In order to be compatible with test discovery, all of the test files must be modules or packages importable from the top-level directory of the project (this means that their filenames must be valid identifiers).

  • Run unittest:

    python -m unittest discover
  • Improve Your Python: Understanding Unit Testing

pytest

The pytest framework makes it easy to write small tests, yet scales to support complex functional testing for applications and libraries. official website

URL RESTful

parse URL:

from urlparse import urlsplit, parse_qsl
url = "http://www.example.org/default.html?user=admin&password=Bdclab123"
query = urlsplit(url).query
params = parse_qsl(query)
print query
print dict(params)

Python OOP

Improve Your Python: Python Classes and Object Oriented Programming

Inheritance

What's the difference?

SomeBaseClass.__init__(self)

means to call SomeBaseClass's __init__. while

super(Child, self).__init__() or super(self.__class__,self).__init__()

means to call a bound __init__ from the parent class that follows Child in the instance's method resolution order.

sample code link

module, packages

if __name__ == '__main__':
  main()

@staticmethod, @classmethod, instance method (self)

The definitive guide on how to use static, class or abstract methods in Python

why self? & __init__() is not a constructor

@classmethod: used as overloading constraction methods @staticmethod: for better organization within class

sample code link

Data Hiding

sample code link

Regular expression

Jekins

Linux commands

  • wget

  • rpm

  • yum

  • systemctl

    • modify firewall setting
    • start stop service