-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
64f0f5a
commit 1af134f
Showing
7 changed files
with
51 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ python-box>=4.0 | |
defusedxml>=0.5.0 | ||
urllib3==1.26.18 | ||
typing-extensions>=3.10.0.2 | ||
requests-toolbelt==1.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,25 @@ | ||
''' | ||
test file for testing various scenarios in file functionality | ||
''' | ||
import os | ||
|
||
from io import BytesIO | ||
import responses | ||
import pytest | ||
|
||
|
||
@pytest.mark.vcr() | ||
def test_files_upload_clear_success(security_center): | ||
''' | ||
test files upload and clear for success | ||
''' | ||
with open('1000003.xml', 'w+') as file: | ||
response = security_center.files.upload(fobj=file) | ||
filename = security_center.files.clear(response) | ||
assert filename == 'filename' | ||
os.remove('1000003.xml') | ||
@responses.activate | ||
def test_files_upload(tsc): | ||
fake = BytesIO(b'Test File') | ||
responses.post('https://nourl/rest/file/upload', | ||
json={ | ||
'error_code': '', | ||
'response': {'filename': 'something'} | ||
}, | ||
) | ||
|
||
assert 'something' == tsc.files.upload(fake) | ||
|
||
#with open('1000003.xml', 'w+') as file: | ||
# response = security_center.files.upload(fobj=file) | ||
# filename = security_center.files.clear(response) | ||
# assert filename == 'filename' | ||
#os.remove('1000003.xml') |