Skip to content
This repository has been archived by the owner on Apr 12, 2020. It is now read-only.

Commit

Permalink
Merge pull request #66 from vogt4nick/2019-03-02-misc-dev
Browse files Browse the repository at this point in the history
Fix some glaring functionality errors
  • Loading branch information
vogt4nick committed Mar 2, 2019
2 parents 841da82 + 83cefcf commit 0ba0064
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.7.0
current_version = 0.8.0
commit = True
tag = False
parse = (?P<major>\d+)
Expand Down
4 changes: 2 additions & 2 deletions dequindre/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from subprocess import check_output, CalledProcessError


__version__ = '0.7.0'
__version__ = '0.8.0'


class CyclicGraphError(Exception):
Expand All @@ -30,7 +30,7 @@ class Task:
loc (str): location of the python script that runs the task.
env (str): Which environment to run.
"""
def __init__(self, loc: str, env: str = 'base'):
def __init__(self, loc: str, env: str = 'python'):
assert isinstance(loc, str), 'loc must be a str'
assert len(loc) > 0, 'loc cannot be an empty string'
assert isinstance(env, str), 'env must be a str'
Expand Down
1 change: 1 addition & 0 deletions tests/test-files/A.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print('I am script A.py')
1 change: 1 addition & 0 deletions tests/test-files/B.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print('I am script B.py')
21 changes: 21 additions & 0 deletions tests/test_Dequindre.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,24 @@ def test__Dequindre_get_schedules():


# test run tasks
def test__Dequindre_run_task():
A = Task('./tests/test-files/A.py')
B = Task('./tests/test-files/B.py')
Z = Task('./tests/test-files/i-dont-exist.py')
dag = DAG(tasks={A, B})
dq = Dequindre(dag)

dq.run_task(A)

with pytest.raises(AssertionError):
dq.run_task(Z)


def test__Dequindre_run_tasks():
A = Task('./tests/test-files/A.py')
B = Task('./tests/test-files/B.py')
dag = DAG(tasks={A, B})
dq = Dequindre(dag)

dq.run_tasks()

2 changes: 1 addition & 1 deletion tests/test_Task.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

def test__Task_init():
good_loc = 'path/to/file.py'
good_env = 'test-env'
good_env = 'python'

with pytest.raises(TypeError):
Task()
Expand Down

0 comments on commit 0ba0064

Please sign in to comment.