Skip to content

Commit

Permalink
fix(tests): manage default variables
Browse files Browse the repository at this point in the history
  • Loading branch information
breakthewall committed Jan 3, 2022
1 parent dde3752 commit 31260f4
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions tests/test_RP2.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@
from shutil import copyfile
from retropath2_wrapper.RetroPath2 import (
retropath2,
__KNIME_VER__,
__RETROPATH2_KWF__,
set_vars,
gunzip_to_csv,
check_inchi_from_file
)
from retropath2_wrapper.Args import (
DEFAULT_KNIME_VERSION,
DEFAULT_RP2_VERSION
)
from retropath2_wrapper.__main__ import create_logger


Expand Down Expand Up @@ -85,29 +87,29 @@ def test_set_vars_None(self):
# Process the function to test
kvars = set_vars(
kexec = None,
kver = None,
kpkg_install = True
)
)

# Prepare expectd data
from retropath2_wrapper import __path__ as rp2_path
rp2_path = rp2_path[0]
kinstall = rp2_path
kver = __KNIME_VER__
kver = DEFAULT_KNIME_VERSION
kpath = os_path.join(kinstall, 'knime_')+kver
kexec = os_path.join(kpath, 'knime')
workflow = os_path.join(
rp2_path,
'workflows',
__RETROPATH2_KWF__
)
f'RetroPath2.0_r{DEFAULT_RP2_VERSION}.knwf'
)
kvars_expected = {
'kexec' : kexec,
'kexec_install' : not os_path.exists(kpath),
'kver' : kver,
'kpath' : kpath,
'kinstall' : kinstall,
'kpkg_install' : True
'kpkg_install' : True,
'workflow' : workflow
}
self.assertDictEqual(kvars, kvars_expected)

Expand Down

0 comments on commit 31260f4

Please sign in to comment.