Giter Site home page Giter Site logo

adityaprakash-bobby / py-tdd Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 382 KB

[WIP] An approach towards test driven development in Python.

Home Page: http://staging.adityaprakash.gq

License: GNU General Public License v3.0

Python 91.46% HTML 8.17% CSS 0.05% JavaScript 0.32%
selenium tdd-python django testing web-application gunicorn-web-server aws fabric

py-tdd's Introduction

py-tdd

A very minimal application made on Django, in order to deliver a heavily tested and automatically deployed To-Do lists webapp.

"Always obey the Testing Goat."

Get it running locally

git clone https://github.com/adityaprakash-bobby/py-tdd
cd py-tdd/

# setup a virtual environment
python3 -m venv virtualenv

# prep the dev server
./virtualenv/bin/pip install -r requirements.txt

# start the dev server
./virtualenv/bin/python manage.py runserver

# run tests
#   e2e test:
./virtualenv/bin/python manage.py test functional_tests
#   unit tests:
./virtualenv/bin/python manage.py test lists

Get it running in the web

I am using an EC2 machine as my deployment server inorder to get my site published. Got a free domain registered at freenom.com. And using a nginx + gunicorn setup for the deployment of the staging and live server. I will be uploading the deployment settings soon.

you can follow the guide in deploy_tools

Using fabric CLI

This will be very specific to deployment to AWS EC2 servers. We assume that you already have the private_key file used to log in to your remote machine. It will be used the same way you use it for logging into EC2 instances. You have to provides the username and host address of the instance.

cd /path/to/your/local/git/repo/

source virtualenv/bin/activate

cd deploy_tools/

fab -i /path/to/private_key.pem deploy:host=username@host_address

py-tdd's People

Contributors

adityaprakash-bobby avatar dependabot[bot] avatar shreyans98 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

shreyans98

py-tdd's Issues

functional_tests.test_layout_and_styling behaving abnormally

The functional test to make sure the input textbox in the pages is center-aligned, is behaving in a very erratic manner. The selenium browser window is resizing to the size I want but, it does pass sometimes and fails the rest of the time.

This problem seemed to occur when I switched from i3environment to gnome environment.

       [...]
       def test_layout_and_styling(self):
              # User goes to the home page
              self.browser.get(self.live_server_url)
              self.browser.set_window_size(1024, 768)

              # He/she notices the input box is nicely centered
              inputbox = self.get_item_input_box()
              self.assertAlmostEqual(
                      inputbox.location['x'] + inputbox.size['width'] / 2,
                      512,
                      delta=10
              )
       [...]

It fails after this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.