Skip to content

Commit

Permalink
Merge pull request #3 from yamaszone/feature/ci-setup
Browse files Browse the repository at this point in the history
Feature/ci setup
  • Loading branch information
yamaszone committed May 16, 2018
2 parents e6752fd + 47d8695 commit 0c7aad8
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
40 changes: 40 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Python CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-python/ for more details
#
version: 2
jobs:
build:
docker:
# use `-browsers` prefix for selenium tests, e.g. `3.6.1-browsers`
- image: circleci/python:3.6.1

working_directory: ~/repo

steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "requirements.txt" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run:
name: install dependencies
command: |
python3 -m venv venv
. venv/bin/activate
./install
- save_cache:
paths:
- ./venv
key: v1-dependencies-{{ checksum "requirements.txt" }}

- run:
name: run tests
command: |
. venv/bin/activate
./run pyunit
4 changes: 2 additions & 2 deletions python/tdd/tests/test_bmi_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
class test_bmi_calculator(unittest.TestCase):

def test_calculate_returns_weight_group(self):
self.assertEqual('Underweight', bmi_calculator.calculate(weight=120, height=72))
self.assertEqual('Underweight', bmi_calculator.calculate(weight=120, height=72))

@unpack
@data(
{'age_group': 'Underweight', 'height': 65, 'weight': 80},
{'age_group': 'Normal', 'height': 72, 'weight': 165}
)
def test_calculate_returns_weight_group_v2(self, age_group, weight, height):
self.assertEqual(age_group, bmi_calculator.calculate(weight, height))
self.assertEqual(age_group, bmi_calculator.calculate(weight, height))

0 comments on commit 0c7aad8

Please sign in to comment.