Skip to content

Development

YuDe edited this page Dec 21, 2017 · 2 revisions

Set up Development Environment

  1. Install required packages for development
	$ pip install -r dev_requirements.txt
  1. Fork this project
  2. Run setup to install sneak locally.
	$ python setup.py develop
  1. Check if the installation works or not.
	$ python 

Edit code and test them

We follow the TDD (Test-Driven Development) to build this project. Therefore, every modification has to be test before be committed.

The steps are listed below:

  1. Edit the code inside sneak folder
  2. Write the test of the code. More detail can be found here.
  3. Make sure your modifications can pass all tests.
  4. Start Pull Request
  5. Review Code by package maintainer
  6. If code works, your code will be merged :)
  1. Go to sneak
  2. Go to test.py
  3. Write Test functions. Please notice several circumstances:
    If you have created a new class, please create a test class inside test.py with naming TestClassname(unittest.TestCase)
    If you add new functions in existing class, find out the corresponding test class in test.py and add new test function start with prefix test_
  4. Run the test for the single function
	$ sudo python test.py TestClassname.test_function
  1. If the unit test is succeed, run whole tests to make sure the modification works!
	$ sudo python test.py

[WARNING] Run tor needs the authentication, that is why we have sudo.

The Coding Style

To make sure package's code is neat and clear, coding style is strict.

Clone this wiki locally