pytoda.tests.utils module¶
Utilities for the tests.
Reference¶
-
class
TestFileContent
(content, **kwargs)[source]¶ Bases:
object
Create a temporary file with a given content.
Inspired by: https://stackoverflow.com/a/54053967/10032558.
-
__init__
(content, **kwargs)[source]¶ Initialize the file with a content.
- Parameters
content (str) – content of the file.
**kwargs (dict) – Additional keyword arguments for NamedTemporaryFile. NOTE: This can e.g. be suffix=’.csv’ if the temporary filename should adhere to a specific suffix.
-
property
filename
¶ Get the name of the file.
- Returns
the file name.
- Return type
str
-