Skip to content

Commit

Permalink
rewrite and run tests
Browse files Browse the repository at this point in the history
- python api tests are now like regular tests in scope
- python api tests include decorator tests
- config reader tests
- jupyter notebook tests
  • Loading branch information
nolanbconaway committed Sep 12, 2018
1 parent b1a6f59 commit ec2a52e
Show file tree
Hide file tree
Showing 7 changed files with 255 additions and 307 deletions.
2 changes: 1 addition & 1 deletion jarjar/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "3.0"
__version__ = "3.1"
1 change: 0 additions & 1 deletion jarjar/jarjar.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ class jarjar(object):
def __init__(self, config=None, **defaults):
"""Init the object."""
# check unexpected args
print(defaults)
for k in defaults.keys():
if k in _EXPECTED_CONFIG:
continue
Expand Down
175 changes: 0 additions & 175 deletions tests/notebook.ipynb

This file was deleted.

41 changes: 36 additions & 5 deletions tests/test-config-reader.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,38 @@
import os
from jarjar import jarjar
jj = jarjar(config='../.jarjar', message='hello2')
print(jj.default_channel)
print(jj.default_message)
print(jj.default_webhook)

# jj.text()

def writetofile(f, **kwargs):
"""write kwargs to a file"""
s = ''
for k, v in kwargs.items():
s += '%s=\'%s\'\n' % (k, v)

with open(f, 'w') as fh:
fh.write(s)


jj = jarjar()
print('-- vanilla')
print('channel', jj.default_channel)
print('message', jj.default_message)
print('webhook', jj.default_webhook)
print()

writetofile('.jarjar', webhook='1', channel='2', message='3')
jj = jarjar()
print('-- inferred .jarjar')
print('channel', jj.default_channel)
print('message', jj.default_message)
print('webhook', jj.default_webhook)
print()
os.remove('.jarjar')

writetofile('.jjconfig', webhook='4', channel='5', message='6')
jj = jarjar(config='.jjconfig')
print('-- specified .jjconfig')
print('channel', jj.default_channel)
print('message', jj.default_message)
print('webhook', jj.default_webhook)
print()
os.remove('.jjconfig')
125 changes: 0 additions & 125 deletions tests/test-jj-module.py

This file was deleted.

Loading

0 comments on commit ec2a52e

Please sign in to comment.