Jaymon / testdata

Python module to make testing easier, it can generate random data like names and text, run commands, fetch urls, create files and directories, and more
MIT License
10 stars 0 forks source link

get_module_name function #47

Closed Jaymon closed 5 years ago

Jaymon commented 5 years ago

something like:

def get_module_name(bits=1, prefix=""):
    parts = []
    for x in range(bits):
        parts.append(get_ascii(5).lower())
    if prefix:
        parts[-1] = "{}{}".format(prefix, parts[-1])

    return ".".join(parts)

Need to make sure every part/bit of the module path doesn't start with a digit, so that's something that will need to be changed from the above code