From ff3f8101adbf9a8b4e6904df53ec1382a4fa7be9 Mon Sep 17 00:00:00 2001 From: Bastian Venthur Date: Sat, 6 Aug 2022 22:29:48 +0200 Subject: [PATCH] added test --- tests/test_blag.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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'])