Skip to content

Commit beeffe8

Browse files
beaucarnesShMcK
authored andcommitted
INIT
0 parents  commit beeffe8

File tree

10 files changed

+205
-0
lines changed

10 files changed

+205
-0
lines changed

.gitignore

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# Editors
2+
.idea/
3+
4+
# Vagrant
5+
.vagrant/
6+
7+
# Mac/OSX
8+
.DS_Store
9+
10+
# Windows
11+
Thumbs.db
12+
13+
# Source for the following rules: https://raw.githubusercontent.com/github/gitignore/master/Python.gitignore
14+
# Byte-compiled / optimized / DLL files
15+
__pycache__/
16+
*.py[cod]
17+
*$py.class
18+
19+
# C extensions
20+
*.so
21+
22+
# Distribution / packaging
23+
.Python
24+
build/
25+
develop-eggs/
26+
dist/
27+
downloads/
28+
eggs/
29+
.eggs/
30+
lib/
31+
lib64/
32+
parts/
33+
sdist/
34+
var/
35+
wheels/
36+
*.egg-info/
37+
.installed.cfg
38+
*.egg
39+
MANIFEST
40+
41+
# PyInstaller
42+
# Usually these files are written by a python script from a template
43+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
44+
*.manifest
45+
*.spec
46+
47+
# Installer logs
48+
pip-log.txt
49+
pip-delete-this-directory.txt
50+
51+
# Unit test / coverage reports
52+
htmlcov/
53+
.tox/
54+
.nox/
55+
.coverage
56+
.coverage.*
57+
.cache
58+
nosetests.xml
59+
coverage.xml
60+
*.cover
61+
.hypothesis/
62+
.pytest_cache/
63+
64+
# Translations
65+
*.mo
66+
*.pot
67+
68+
# Django stuff:
69+
*.log
70+
local_settings.py
71+
db.sqlite3
72+
73+
# Flask stuff:
74+
instance/
75+
.webassets-cache
76+
77+
# Scrapy stuff:
78+
.scrapy
79+
80+
# Sphinx documentation
81+
docs/_build/
82+
83+
# PyBuilder
84+
target/
85+
86+
# Jupyter Notebook
87+
.ipynb_checkpoints
88+
89+
# IPython
90+
profile_default/
91+
ipython_config.py
92+
93+
# pyenv
94+
.python-version
95+
96+
# celery beat schedule file
97+
celerybeat-schedule
98+
99+
# SageMath parsed files
100+
*.sage.py
101+
102+
# Environments
103+
.env
104+
.venv
105+
env/
106+
venv/
107+
ENV/
108+
env.bak/
109+
venv.bak/
110+
111+
# Spyder project settings
112+
.spyderproject
113+
.spyproject
114+
115+
# Rope project settings
116+
.ropeproject
117+
118+
# mkdocs documentation
119+
/site
120+
121+
# mypy
122+
.mypy_cache/
123+
.dmypy.json
124+
dmypy.json
125+
126+
# binary
127+
*.pyc

.vscode/launch.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"configurations": [
3+
{
4+
"name": "Python: Current File",
5+
"type": "python",
6+
"request": "launch",
7+
"program": "${file}",
8+
"console": "integratedTerminal"
9+
}
10+
]
11+
}

.vscode/settings.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"[python]": {
3+
"editor.rulers": [
4+
72,
5+
79
6+
],
7+
"editor.tabSize": 4,
8+
"editor.insertSpaces": true
9+
},
10+
"python.linting.pylintEnabled": true,
11+
"python.linting.lintOnSave": true,
12+
"python.formatting.provider": "yapf"
13+
}

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
init:
2+
pip install -r requirements.txt
3+
4+
test:
5+
python tests/*_test.py

pyvenv.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
home = /usr/local/bin
2+
include-system-site-packages = false
3+
version = 3.7.7

requirements.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
astroid==2.4.2
2+
isort==4.3.21
3+
lazy-object-proxy==1.4.3
4+
mccabe==0.6.1
5+
pylint==2.5.3
6+
six==1.15.0
7+
tap.py==3.0
8+
toml==0.10.1
9+
typed-ast==1.4.1
10+
wrapt==1.12.1

src/example.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Solution
2+
def add(*args):
3+
'''Add 1 or more numbers together'''
4+
return 0
5+
6+
def main():
7+
print('add(1) = ' + str(add(1)))
8+
print('add(1, 2) = ' + str(add(1, 2)))
9+
print('add(1, 2, 3) = ' + str(add(1, 2, 3)))
10+
11+
if __name__ == '__main__':
12+
main()

tests/__init__.py

Whitespace-only changes.

tests/context.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import sys
2+
import os
3+
sys.path.insert(0, os.path.abspath(
4+
os.path.join(os.path.dirname(__file__), '..')))
5+
6+
import src

tests/math_test.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import unittest
2+
import sys
3+
sys.path.append('./src')
4+
5+
from example import add
6+
7+
class MathTest(unittest.TestCase):
8+
def test_add_no_numbers(self):
9+
self.assertEqual(add(), 0, "Should return 0 with no params")
10+
def test_add_one_number(self):
11+
self.assertEqual(add(1), 1, "Should add one number to 0")
12+
def test_add_two_numbers(self):
13+
self.assertEqual(add(1, 2), 3, "Should add two numbers together")
14+
def test_add_three_numbers(self):
15+
self.assertEqual(add(1, 2, 3), 6, "Should add three numbers together")
16+
17+
if __name__ == '__main__':
18+
unittest.main()

0 commit comments

Comments
 (0)