# Path: genotp.py
# def rndcaps(n):
#     """
#     Generates a string of random capital letters.
# 
#     Arguments:
#         n: Length of the output string.
# 
#     Returns:
#         A string of n random capital letters.
#     """
#     return "".join([choice(_CAPS) for c in range(n)])
# 
# def otp(n=65):
#     """
#     Return a one-time pad.
# 
#     Arguments:
#         n: number of lines in the key
# 
#     Returns:
#         n lines of 12 groups of 5 random capital letters.
#     """
#     lines = []
#     for num in range(1, n + 1):
#         i = [f"{num:02d} "]
#         i += [rndcaps(5) for j in range(0, 12)]
#         lines.append(" ".join(i))
#     return "\n".join(lines)
# 
# Path: genpw.py
# def shannon(n):
# def genpw(length, encoder):
# 
# Path: offsetsrt.py
# def str2ms(s):
#     """
#     Convert the time strings from an SRT file to milliseconds.
# 
#     Arguments:
#         s: A time value in the format HH:MM:SS,mmm where H, M, S and m are
#            digits.
# 
#     Returns:
#         The time string converted to an integer value in milliseconds.
#     """
#     s = s.strip()
#     time, ms = s.split(",")
#     h, m, s = time.split(":")
#     return int(ms) + 1000 * (int(s) + 60 * (int(m) + 60 * int(h)))
# 
# def ms2str(v):
#     """
#     Convert a time in milliseconds to a time string.
# 
#     Arguments:
#         v: a time in milliseconds.
# 
#     Returns:
#         A string in the format HH:MM:SS,mmm.
#     """
#     v, ms = divmod(v, 1000)
#     v, s = divmod(v, 60)
#     h, m = divmod(v, 60)
#     return f"{h:02d}:{m:02d}:{s:02d},{ms:03d}"


from collections import Counter
from genotp import rndcaps, otp
from genpw import roundup, genpw
from nospaces import fixname
from offsetsrt import str2ms, ms2str
    for ln in lines:
        assert len(ln) == 75


def test_roundup():
    assert roundup(1) == 3
    assert roundup(2) == 3
    assert roundup(3) == 3
    assert roundup(4) == 3
    assert roundup(5) == 6
    assert roundup(6) == 6
    assert roundup(7) == 6
    assert roundup(8) == 6
    assert roundup(9) == 9


def test_genpw():
    for n in range(12):
        assert len(genpw(n)) == n


def test_fixname():
    rv = fixname("dit is  een\ttest")
    assert rv == "dit_is_een_test"


def test_srt():
    for j in range(7200):
        p = j * 10
        ts = ms2str(p)

# Path: genotp.py
# def rndcaps(n):
#     """
#     Generates a string of random capital letters.
# 
#     Arguments:
#         n: Length of the output string.
# 
#     Returns:
#         A string of n random capital letters.
#     """
#     return "".join([choice(_CAPS) for c in range(n)])
# 
# def otp(n=65):
#     """
#     Return a one-time pad.
# 
#     Arguments:
#         n: number of lines in the key
# 
#     Returns:
#         n lines of 12 groups of 5 random capital letters.
#     """
#     lines = []
#     for num in range(1, n + 1):
#         i = [f"{num:02d} "]
#         i += [rndcaps(5) for j in range(0, 12)]
#         lines.append(" ".join(i))
#     return "\n".join(lines)
# 
# Path: genpw.py
# def shannon(n):
# def genpw(length, encoder):
# 
# Path: offsetsrt.py
# def str2ms(s):
#     """
#     Convert the time strings from an SRT file to milliseconds.
# 
#     Arguments:
#         s: A time value in the format HH:MM:SS,mmm where H, M, S and m are
#            digits.
# 
#     Returns:
#         The time string converted to an integer value in milliseconds.
#     """
#     s = s.strip()
#     time, ms = s.split(",")
#     h, m, s = time.split(":")
#     return int(ms) + 1000 * (int(s) + 60 * (int(m) + 60 * int(h)))
# 
# def ms2str(v):
#     """
#     Convert a time in milliseconds to a time string.
# 
#     Arguments:
#         v: a time in milliseconds.
# 
#     Returns:
#         A string in the format HH:MM:SS,mmm.
#     """
#     v, ms = divmod(v, 1000)
#     v, s = divmod(v, 60)
#     h, m = divmod(v, 60)
#     return f"{h:02d}:{m:02d}:{s:02d},{ms:03d}"


# Path: scripts-tests.py
from collections import Counter
from genotp import rndcaps, otp
from genpw import roundup, genpw
from nospaces import fixname
from offsetsrt import str2ms, ms2str

    for ln in lines:
        assert len(ln) == 75


def test_roundup():
    assert roundup(1) == 3
    assert roundup(2) == 3
    assert roundup(3) == 3
    assert roundup(4) == 3
    assert roundup(5) == 6
    assert roundup(6) == 6
    assert roundup(7) == 6
    assert roundup(8) == 6
    assert roundup(9) == 9


def test_genpw():
    for n in range(12):
        assert len(genpw(n)) == n


def test_fixname():
    rv = fixname("dit is  een\ttest")
    assert rv == "dit_is_een_test"


def test_srt():
    for j in range(7200):
        p = j * 10
        ts = ms2str(p)

        k = str2ms(ts)