Commit 6db6eb04475ba7d899cccb6f5dc95d1aaa2a2c11
1 parent
1d8d5d29
Update `create_fake_doc()`
Return path to created file, basename of created file and content of created file instead of name of created file (and path to it at the same time). It is made in order to delete file after uploading and save all useful data in Robot Framework variables.
Showing
1 changed file
with
2 additions
and
1 deletions
... | ... | @@ -6,6 +6,7 @@ from uuid import uuid4 |
6 | 6 | from tempfile import NamedTemporaryFile |
7 | 7 | from .local_time import get_now |
8 | 8 | from op_faker import OP_Provider |
9 | +import os | |
9 | 10 | import random |
10 | 11 | |
11 | 12 | |
... | ... | @@ -44,7 +45,7 @@ def create_fake_doc(): |
44 | 45 | tf = NamedTemporaryFile(delete=False, suffix=suffix, prefix=prefix) |
45 | 46 | tf.write(content) |
46 | 47 | tf.close() |
47 | - return tf.name | |
48 | + return tf.name, os.path.basename(tf.name), content | |
48 | 49 | |
49 | 50 | |
50 | 51 | def test_tender_data(params, periods=("enquiry", "tender")): | ... | ... |
Please
register
or
login
to post a comment