From 9cce39293cd7be388cc95e1135eaf5f9102b7e69 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 16 Dec 2023 14:03:16 -0500 Subject: [PATCH] Add tests for invalid separators. --- zipp/glob.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/zipp/glob.py b/zipp/glob.py index 8a8260d..69c41d7 100644 --- a/zipp/glob.py +++ b/zipp/glob.py @@ -6,10 +6,22 @@ class Translator: + """ + >>> Translator('xyz') + Traceback (most recent call last): + ... + AssertionError: Invalid separators + + >>> Translator('') + Traceback (most recent call last): + ... + AssertionError: Invalid separators + """ + seps: str def __init__(self, seps: str = _default_seps): - assert seps in ('/', '\\', '\\/') + assert seps and set(seps) <= set(_default_seps), "Invalid separators" self.seps = seps def translate(self, pattern):