def setUp(self): logging.basicConfig() logging.getLogger("wetransfer-python-sdk").setLevel(logging.DEBUG) self.mock_handler = MockLoggingHandler() LOGGER.addHandler(self.mock_handler) self.temp_file = tempfile.NamedTemporaryFile() with open(self.temp_file.name, 'w') as f: f.write("123456")
def setUp(self): self.key = "dummy_key" self.server = "dummy_server" self.client = WTApiClient(**{"key": self.key, "server": self.server}) logging.basicConfig() logging.getLogger("wetransfer-python-sdk").setLevel(logging.DEBUG) self.mock_handler = MockLoggingHandler() LOGGER.addHandler(self.mock_handler)
def setUp(self): self.kwargs = { "key": "test_key", "token": "test_token", "server": "test_server", } logging.basicConfig() logging.getLogger("wetransfer-python-sdk").setLevel(logging.DEBUG) self.mock_handler = MockLoggingHandler() LOGGER.addHandler(self.mock_handler)
def setUp(self): self.kwargs = { "client_options": { "key": "test_key", "token": "test_token", "server": "test_server", }, "id": 1, "part_number": 1, "multipart_upload_id": 1 } logging.basicConfig() logging.getLogger("wetransfer-python-sdk").setLevel(logging.DEBUG) self.mock_handler = MockLoggingHandler() LOGGER.addHandler(self.mock_handler)
def setUp(self): logging.basicConfig() logging.getLogger("wetransfer-python-sdk").setLevel(logging.DEBUG) self.mock_handler = MockLoggingHandler() LOGGER.addHandler(self.mock_handler) finish_response = FakeResponse(ok=True) self.mock_get_upload_url = mock.patch( "wetransfer.api_requests.GetUploadURL.create").start() self.mock_upload_part = mock.patch( "wetransfer.api_requests.UploadPart.create").start() self.temp_file = tempfile.NamedTemporaryFile() with open(self.temp_file.name, 'w') as f: f.write("123456") self.item = File(self.temp_file.name) self.item.client_options = {} self.item.id = 1
def setUp(self): self.kwargs = { "key": "test_key", "token": "test_token", "server": "test_server", } logging.basicConfig() logging.getLogger("wetransfer-python-sdk").setLevel(logging.DEBUG) self.mock_handler = MockLoggingHandler() LOGGER.addHandler(self.mock_handler) self.expected_agent = "WT python SDK v{0}".format(__version__) self.expected_headers = { "User-Agent": self.expected_agent, "Content-Type": "application/json", "x-api-key": self.kwargs["key"], "Authorization": "Bearer {0}".format(self.kwargs["token"]) }
def setUp(self): logging.basicConfig() logging.getLogger("wetransfer-python-sdk").setLevel(logging.DEBUG) self.mock_handler = MockLoggingHandler() LOGGER.addHandler(self.mock_handler) self.mock_finish_upload = mock.patch( "wetransfer.api_requests.FinishUpload.create", ).start() self.mock_upload_part = mock.patch( "wetransfer.items.File.upload_part", ).start() self.temp_file = tempfile.NamedTemporaryFile() with open(self.temp_file.name, 'w') as f: f.write("123456") self.item = File(self.temp_file.name) self.item.client_options = {} self.item.id = 1
def setUp(self): logging.basicConfig() logging.getLogger("wetransfer-python-sdk").setLevel(logging.DEBUG) self.mock_handler = MockLoggingHandler() LOGGER.addHandler(self.mock_handler) self.httpLogger = HTTPLogger()