Skip to content

Commit

Permalink
Merge 23f3c66 into e64fde8
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasheinrich committed Jan 14, 2018
2 parents e64fde8 + 23f3c66 commit 6c7affb
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
2 changes: 0 additions & 2 deletions packtivity/handlers/environment_handlers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import packtivity.utils as utils

handlers,environment = utils.handler_decorator()

#this will in the future handle the env-building
2 changes: 1 addition & 1 deletion packtivity/statecontexts/posixfs_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def contextualize_value(self,value):
def model(self, data):
data = data.copy()
for p, v in data.leafs():
p.set(data, self.contextualize_value(v))
data.replace(p,self.contextualize_value(v))
return data

def json(self):
Expand Down
1 change: 0 additions & 1 deletion packtivity/syncbackends.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ def run_packtivity(spec, parameters,state,metadata,config):
job = build_job(spec['process'], parameters, state, config)
env = build_env(spec['environment'], parameters, state, config)
run_in_env(env,job,state,metadata,config)

pubdata = publish(spec['publisher'], parameters,state, config)
log.info('publishing data: %s',pubdata)
return pubdata
Expand Down
3 changes: 3 additions & 0 deletions packtivity/typedleafs.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ def __init__(self,data, leafmodel = None, idleafs = False):
data = data.json()
self._jsonable = data

def __repr__(self):
return '<TypedLeafs: {}>'.format(self.typed())

def __getitem__(self,key):
return self.typed().__getitem__(key)
def __iter__(self):
Expand Down
10 changes: 9 additions & 1 deletion tests/test_statecontexts.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
import os
from packtivity.typedleafs import TypedLeafs
def test_pack_call_local(tmpdir,basic_localfs_state):

from packtivity.statecontexts.posixfs_context import LocalFSState
pars = TypedLeafs({'parcard': ['{workdir}/parcard.dat'], 'banner_file': '{workdir}/banner.txt'})

newpars = basic_localfs_state.model(pars)

assert type(pars) == TypedLeafs
assert newpars['banner_file'] == os.path.join(str(tmpdir), 'banner.txt')
assert newpars['parcard'][0] == os.path.join(str(tmpdir), 'parcard.dat')

0 comments on commit 6c7affb

Please sign in to comment.