diff options
Diffstat (limited to 'src/mailman_pgp/testing/layers.py')
| -rw-r--r-- | src/mailman_pgp/testing/layers.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/mailman_pgp/testing/layers.py b/src/mailman_pgp/testing/layers.py index dcba526..986a388 100644 --- a/src/mailman_pgp/testing/layers.py +++ b/src/mailman_pgp/testing/layers.py @@ -15,8 +15,6 @@ # You should have received a copy of the GNU General Public License along with # this program. If not, see <http://www.gnu.org/licenses/>. import contextlib -import os -from os.path import isfile from mailman.testing.layers import (ConfigLayer, RESTLayer, SMTPLayer) from sqlalchemy.exc import SQLAlchemyError @@ -31,11 +29,11 @@ def reset_rollback(): def reset_pgp_dirs(): - for keydir in (config.pgp.keydir_config.values()): - for path in os.listdir(keydir): - full_path = os.path.join(keydir, path) - if isfile(full_path): - os.remove(full_path) + for keydir in (config.pgp.keydirs.values()): + for path in keydir.iterdir(): + full_path = keydir.joinpath(path) + if full_path.is_file(): + full_path.unlink() def reset_pgp_hard(): |
