Did I find the right examples for you? yes no

All Samples(5)  |  Call(4)  |  Derive(0)  |  Import(1)

        def upload_tmp_txt_file(content=''):
    conf.pub_key = 'demopublickey'

    tmp_txt_file = NamedTemporaryFile(mode='wb', delete=False)
    tmp_txt_file.write(content.encode('utf-8'))
    tmp_txt_file.close()

    with open(tmp_txt_file.name, 'rb') as fh:
        file_ = File.upload(fh)
    return file_
        


src/p/y/pyuploadcare-HEAD/tests/integration/test_api_resources.py   pyuploadcare(Download)
from pyuploadcare.api_resources import File, FileGroup, FileList
 
from .utils import upload_tmp_txt_file, create_file_group, skip_on_travis
 
 
    def setUpClass(cls):
        conf.pub_key = 'demopublickey'
        conf.secret = 'demoprivatekey'
        cls.file_ = upload_tmp_txt_file(content='hello')
 
    def setUp(self):
        conf.pub_key = 'demopublickey'
        conf.secret = 'demoprivatekey'
 
        self.file_ = upload_tmp_txt_file(content='пока')
    def setUp(self):
        conf.pub_key = 'demopublickey'
        conf.secret = 'demoprivatekey'
 
        self.file_ = upload_tmp_txt_file(content='привет')
    def test_successful_create(self):
        files = [
            upload_tmp_txt_file(content='пока'),
        ]
        group = FileGroup.create(files)