Skip to content

Commit

Permalink
better tests for migration
Browse files Browse the repository at this point in the history
  • Loading branch information
paulkorir committed Apr 3, 2020
1 parent 729baeb commit df8c93a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name='sfftk-migrate',
version='0.1.0b3',
version='0.1.0b4',
packages=find_packages(),
url='',
license='Apache 2.0',
Expand Down
17 changes: 16 additions & 1 deletion sfftk_migrate/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,26 @@ def test_do_migration(self):
)
args = parse_args(cmd)
_print(args)
do_migration(
status = do_migration(
args
)
self.assertEqual(status, os.EX_OK)
source_version = get_source_version(os.path.join(XML, 'my_file_out.sff'))
self.assertEqual(source_version, '0.8.0.dev1')
os.remove(os.path.join(XML, 'my_file_out.sff'))

def test_do_migration_null(self):
"""Try to migrate a migrated file"""
cmd = "{infile} --target-version 0.7.0.dev0 --outfile {outfile}".format(
infile=os.path.join(XML, 'test2.sff'),
outfile=os.path.join(XML, 'my_file_out.sff')
)
args = parse_args(cmd)
_print(args)
status = do_migration(args)
self.assertEqual(status, os.EX_OK)
self.assertFalse(os.path.exists(os.path.join(XML, 'my_file_out.sff')))

def test_get_module(self):
"""Check that we can get the right module for this migration"""
module = get_module('1', '2')
Expand Down

0 comments on commit df8c93a

Please sign in to comment.