mirror of
https://github.com/cool-RR/PySnooper.git
synced 2026-01-23 10:15:11 +00:00
Change to is None and create strings with %s
This commit is contained in:
parent
5aa10df848
commit
55bb6a35cf
1 changed files with 17 additions and 17 deletions
|
|
@ -7,63 +7,63 @@ from pysnooper.tracer import ansible_filename_pattern
|
|||
def test_ansible_filename_pattern():
|
||||
archive_file = '/tmp/ansible_my_module_payload_xyz1234/ansible_my_module_payload.zip'
|
||||
source_code_file = 'ansible/modules/my_module.py'
|
||||
file_name = archive_file + '/' + source_code_file
|
||||
file_name = '%s/%s' % (archive_file, source_code_file)
|
||||
assert ansible_filename_pattern.match(file_name).group(1) == archive_file
|
||||
assert ansible_filename_pattern.match(file_name).group(2) == source_code_file
|
||||
|
||||
archive_file = '/tmp/ansible_my_module_payload_xyz1234/ansible_my_module_with.zip_name.zip'
|
||||
source_code_file = 'ansible/modules/my_module.py'
|
||||
file_name = archive_file + '/' + source_code_file
|
||||
file_name = '%s/%s' % (archive_file, source_code_file)
|
||||
assert ansible_filename_pattern.match(file_name).group(1) == archive_file
|
||||
assert ansible_filename_pattern.match(file_name).group(2) == source_code_file
|
||||
|
||||
archive_file = '/my/new/path/payload.zip'
|
||||
source_code_file = 'ansible/modules/my_module.py'
|
||||
file_name = archive_file + '/' + source_code_file
|
||||
file_name = '%s/%s' % (archive_file, source_code_file)
|
||||
assert ansible_filename_pattern.match(file_name).group(1) == archive_file
|
||||
assert ansible_filename_pattern.match(file_name).group(2) == source_code_file
|
||||
|
||||
archive_file = '/tmp/ansible_my_module_payload_xyz1234/ansible_my_module_payload.zip'
|
||||
source_code_file = 'ansible/modules/in/new/path/my_module.py'
|
||||
file_name = archive_file + '/' + source_code_file
|
||||
file_name = '%s/%s' % (archive_file, source_code_file)
|
||||
assert ansible_filename_pattern.match(file_name).group(1) == archive_file
|
||||
assert ansible_filename_pattern.match(file_name).group(2) == source_code_file
|
||||
|
||||
archive_file = '/tmp/ansible_my_module_payload_xyz1234/ansible_my_module_payload.zip'
|
||||
source_code_file = 'ansible/modules/my_module_is_called_.py.py'
|
||||
file_name = archive_file + '/' + source_code_file
|
||||
file_name = '%s/%s' % (archive_file, source_code_file)
|
||||
assert ansible_filename_pattern.match(file_name).group(1) == archive_file
|
||||
assert ansible_filename_pattern.match(file_name).group(2) == source_code_file
|
||||
|
||||
archive_file = '/tmp/ansible_my_module_payload_xyz1234/ansible_my_module_payload.zip'
|
||||
source_code_file = 'ANSIBLE/modules/my_module.py'
|
||||
file_name = archive_file + '/' + source_code_file
|
||||
assert ansible_filename_pattern.match(file_name) == None
|
||||
file_name = '%s/%s' % (archive_file, source_code_file)
|
||||
assert ansible_filename_pattern.match(file_name) is None
|
||||
|
||||
archive_file = '/tmp/ansible_my_module_payload_xyz1234/ansible_my_module_payload.zip'
|
||||
source_code_file = 'ansible/modules/my_module.PY'
|
||||
file_name = archive_file + '/' + source_code_file
|
||||
assert ansible_filename_pattern.match(file_name) == None
|
||||
file_name = '%s/%s' % (archive_file, source_code_file)
|
||||
assert ansible_filename_pattern.match(file_name) is None
|
||||
|
||||
archive_file = '/tmp/ansible_my_module_payload_xyz1234/ansible_my_module_payload.Zip'
|
||||
source_code_file = 'ansible/modules/my_module.py'
|
||||
file_name = archive_file + '/' + source_code_file
|
||||
assert ansible_filename_pattern.match(file_name) == None
|
||||
file_name = '%s/%s' % (archive_file, source_code_file)
|
||||
assert ansible_filename_pattern.match(file_name) is None
|
||||
|
||||
archive_file = '/tmp/ansible_my_module_payload_xyz1234/ansible_my_module_payload.zip'
|
||||
source_code_file = 'ansible/my_module.py'
|
||||
file_name = archive_file + '/' + source_code_file
|
||||
assert ansible_filename_pattern.match(file_name) == None
|
||||
file_name = '%s/%s' % (archive_file, source_code_file)
|
||||
assert ansible_filename_pattern.match(file_name) is None
|
||||
|
||||
archive_file = '/tmp/ansible_my_module_payload_xyz1234/ansible_my_module_payload.zip'
|
||||
source_code_file = ''
|
||||
file_name = archive_file + '/' + source_code_file
|
||||
assert ansible_filename_pattern.match(file_name) == None
|
||||
file_name = '%s/%s' % (archive_file, source_code_file)
|
||||
assert ansible_filename_pattern.match(file_name) is None
|
||||
|
||||
archive_file = ''
|
||||
source_code_file = 'ansible/modules/my_module.py'
|
||||
file_name = archive_file + '/' + source_code_file
|
||||
assert ansible_filename_pattern.match(file_name) == None
|
||||
file_name = '%s/%s' % (archive_file, source_code_file)
|
||||
assert ansible_filename_pattern.match(file_name) is None
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue