added test

This commit is contained in:
Bastian Venthur
2022-08-06 22:29:48 +02:00
parent 8c0e69b2f4
commit ff3f8101ad

View File

@@ -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'])