Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_parse_lengths():
assert parse_lengths("25") == (25, )
assert parse_lengths("17:25") == (17, 25)
assert parse_lengths("25:") == (25, None)
assert parse_lengths(":25") == (None, 25)
with pytest.raises(CommandLineError):
parse_lengths("1:2:3")
with pytest.raises(CommandLineError):
parse_lengths("a:2")
with pytest.raises(CommandLineError):
parse_lengths("a")
with pytest.raises(CommandLineError):
parse_lengths("2:a")
with pytest.raises(CommandLineError):
parse_lengths(":")
def test_parse_lengths():
assert parse_lengths("25") == (25, )
assert parse_lengths("17:25") == (17, 25)
assert parse_lengths("25:") == (25, None)
assert parse_lengths(":25") == (None, 25)
with pytest.raises(CommandLineError):
parse_lengths("1:2:3")
with pytest.raises(CommandLineError):
parse_lengths("a:2")
with pytest.raises(CommandLineError):
parse_lengths("a")
with pytest.raises(CommandLineError):
parse_lengths("2:a")
with pytest.raises(CommandLineError):
parse_lengths(":")
def test_parse_lengths():
assert parse_lengths("25") == (25, )
assert parse_lengths("17:25") == (17, 25)
assert parse_lengths("25:") == (25, None)
assert parse_lengths(":25") == (None, 25)
with pytest.raises(CommandLineError):
parse_lengths("1:2:3")
with pytest.raises(CommandLineError):
parse_lengths("a:2")
with pytest.raises(CommandLineError):
parse_lengths("a")
with pytest.raises(CommandLineError):
parse_lengths("2:a")
with pytest.raises(CommandLineError):
parse_lengths(":")
def test_parse_lengths():
assert parse_lengths("25") == (25, )
assert parse_lengths("17:25") == (17, 25)
assert parse_lengths("25:") == (25, None)
assert parse_lengths(":25") == (None, 25)
with pytest.raises(CommandLineError):
parse_lengths("1:2:3")
with pytest.raises(CommandLineError):
parse_lengths("a:2")
with pytest.raises(CommandLineError):
parse_lengths("a")
with pytest.raises(CommandLineError):
parse_lengths("2:a")
with pytest.raises(CommandLineError):
parse_lengths(":")
def test_parse_lengths():
assert parse_lengths("25") == (25, )
assert parse_lengths("17:25") == (17, 25)
assert parse_lengths("25:") == (25, None)
assert parse_lengths(":25") == (None, 25)
with pytest.raises(CommandLineError):
parse_lengths("1:2:3")
with pytest.raises(CommandLineError):
parse_lengths("a:2")
with pytest.raises(CommandLineError):
parse_lengths("a")
with pytest.raises(CommandLineError):
parse_lengths("2:a")
with pytest.raises(CommandLineError):
parse_lengths(":")
def test_parse_lengths():
assert parse_lengths("25") == (25, )
assert parse_lengths("17:25") == (17, 25)
assert parse_lengths("25:") == (25, None)
assert parse_lengths(":25") == (None, 25)
with pytest.raises(CommandLineError):
parse_lengths("1:2:3")
with pytest.raises(CommandLineError):
parse_lengths("a:2")
with pytest.raises(CommandLineError):
parse_lengths("a")
with pytest.raises(CommandLineError):
parse_lengths("2:a")
with pytest.raises(CommandLineError):
parse_lengths(":")
def test_parse_lengths():
assert parse_lengths("25") == (25, )
assert parse_lengths("17:25") == (17, 25)
assert parse_lengths("25:") == (25, None)
assert parse_lengths(":25") == (None, 25)
with pytest.raises(CommandLineError):
parse_lengths("1:2:3")
with pytest.raises(CommandLineError):
parse_lengths("a:2")
with pytest.raises(CommandLineError):
parse_lengths("a")
with pytest.raises(CommandLineError):
parse_lengths("2:a")
with pytest.raises(CommandLineError):
parse_lengths(":")
def test_parse_lengths():
assert parse_lengths("25") == (25, )
assert parse_lengths("17:25") == (17, 25)
assert parse_lengths("25:") == (25, None)
assert parse_lengths(":25") == (None, 25)
with pytest.raises(CommandLineError):
parse_lengths("1:2:3")
with pytest.raises(CommandLineError):
parse_lengths("a:2")
with pytest.raises(CommandLineError):
parse_lengths("a")
with pytest.raises(CommandLineError):
parse_lengths("2:a")
with pytest.raises(CommandLineError):
parse_lengths(":")
def test_parse_lengths():
assert parse_lengths("25") == (25, )
assert parse_lengths("17:25") == (17, 25)
assert parse_lengths("25:") == (25, None)
assert parse_lengths(":25") == (None, 25)
with pytest.raises(CommandLineError):
parse_lengths("1:2:3")
with pytest.raises(CommandLineError):
parse_lengths("a:2")
with pytest.raises(CommandLineError):
parse_lengths("a")
with pytest.raises(CommandLineError):
parse_lengths("2:a")
with pytest.raises(CommandLineError):
parse_lengths(":")