Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

paloalto unit tests don't handle Window path literals properly #1270

Closed
pcoccoli opened this issue Jan 5, 2023 · 1 comment
Closed

paloalto unit tests don't handle Window path literals properly #1270

pcoccoli opened this issue Jan 5, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@pcoccoli
Copy link
Contributor

pcoccoli commented Jan 5, 2023

Describe the bug
pytest reports DeprecationWarning: invalid escape sequence \W in stix_shifter_modules/paloalto/tests/stix_translation/test_paloalto_json_to_stix.py

To Reproduce
Steps to reproduce the behavior:

  1. Run pytest
  2. See warning summary (copied below)

Expected behavior
Should either use double backslash for Windows paths or Python raw strings.

Screenshots

  /home/runner/work/stix-shifter/stix-shifter/stix_shifter_modules/paloalto/tests/stix_translation/test_paloalto_json_to_stix.py:84: DeprecationWarning: invalid escape sequence \W
    data = {'xdr_data': {'action_process_image_command_line': 'C:\Windows\system32\lsass.exe',

stix_shifter_modules/paloalto/tests/stix_translation/test_paloalto_json_to_stix.py:85
  /home/runner/work/stix-shifter/stix-shifter/stix_shifter_modules/paloalto/tests/stix_translation/test_paloalto_json_to_stix.py:85: DeprecationWarning: invalid escape sequence \W
    'actor_process_command_line': 'C:\Windows\system32\lsass.exe',

stix_shifter_modules/paloalto/tests/stix_translation/test_paloalto_json_to_stix.py:86
  /home/runner/work/stix-shifter/stix-shifter/stix_shifter_modules/paloalto/tests/stix_translation/test_paloalto_json_to_stix.py:86: DeprecationWarning: invalid escape sequence \W
    'causality_actor_process_command_line': 'C:\Windows\system32\lsass.exe',

stix_shifter_modules/paloalto/tests/stix_translation/test_paloalto_json_to_stix.py:87
  /home/runner/work/stix-shifter/stix-shifter/stix_shifter_modules/paloalto/tests/stix_translation/test_paloalto_json_to_stix.py:87: DeprecationWarning: invalid escape sequence \W
    'os_actor_process_command_line': 'C:\Windows\system32\lsass.exe',

stix_shifter_modules/paloalto/tests/stix_translation/test_paloalto_json_to_stix.py:120
  /home/runner/work/stix-shifter/stix-shifter/stix_shifter_modules/paloalto/tests/stix_translation/test_paloalto_json_to_stix.py:120: DeprecationWarning: invalid escape sequence \W
    assert process_obj['command_line'] == 'C:\Windows\system32\lsass.exe'
@pcoccoli pcoccoli added the bug Something isn't working label Jan 5, 2023
thangaraj-ramesh added a commit to thangaraj-ramesh/stix-shifter that referenced this issue Jan 6, 2023
Updated the test cases with double backslash for Windows paths.
delliott90 pushed a commit that referenced this issue Jan 10, 2023
Updated the test cases with double backslash for Windows paths.
@delliott90
Copy link
Collaborator

Fixed with #1272.

delliott90 pushed a commit that referenced this issue Jan 24, 2023
Updated the test cases with double backslash for Windows paths.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants