Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Commit

Permalink
fix: restore create_static_file
Browse files Browse the repository at this point in the history
  • Loading branch information
antonagestam committed Oct 3, 2019
1 parent 38a2af0 commit b3d7f26
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions collectfast/tests/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import functools
import os
import pathlib
import secrets
import random
import unittest
import uuid
from typing import Any
Expand Down Expand Up @@ -33,8 +33,8 @@ def test(func):
return case


# _type: (Callable[[F], F]) -> Callable[[F], F]
def test_many(**mutations):
# type: (Callable[[F], F]) -> Callable[[F], F]
def test(func):
"""
Creates a class that inherits from `unittest.TestCase` with the decorated
Expand All @@ -59,10 +59,11 @@ def test(func):

def create_static_file():
# type: () -> None
# write random characters to a file in the static directory
"""Write random characters to a file in the static directory."""
filename = "%s.txt" % uuid.uuid4().hex
with (static_dir / filename).open("w+") as file_:
file_.write(secrets.token_hex(32))
for _ in range(500):
file_.write(chr(int(random.random() * 64)))


def clean_static_dir():
Expand Down

0 comments on commit b3d7f26

Please sign in to comment.