diff --git a/tests/test_blag.py b/tests/test_blag.py index 72dbf37..91f1ac2 100644 --- a/tests/test_blag.py +++ b/tests/test_blag.py @@ -275,6 +275,21 @@ foo bar blag.build(args) +def test_remove_extra_files(args): + # create a file and directory in output dir that have no corresponding + # source + file_path = f'{args.output_dir}/a' + dir_path = f'{args.output_dir}/b' + fh = open(file_path, 'w') + fh.close() + os.mkdir(dir_path) + + blag.build(args) + + assert not os.path.exists(file_path) + assert not os.path.exists(dir_path) + + def test_main(cleandir): blag.main(['build'])