Style changes to satisfy the 'style' tox check
parent
a150b0f4aa
commit
d61b543266
|
@ -39,7 +39,7 @@ def _validate_selector(obj, selector):
|
|||
|
||||
|
||||
def _get_marking_id(marking):
|
||||
if type(marking).__name__ is 'MarkingDefinition': # avoid circular import
|
||||
if type(marking).__name__ == 'MarkingDefinition': # avoid circular import
|
||||
return marking.id
|
||||
return marking
|
||||
|
||||
|
|
|
@ -182,7 +182,7 @@ class ListProperty(Property):
|
|||
|
||||
if type(self.contained) is EmbeddedObjectProperty:
|
||||
obj_type = self.contained.type
|
||||
elif type(self.contained).__name__ is "STIXObjectProperty":
|
||||
elif type(self.contained).__name__ == "STIXObjectProperty":
|
||||
# ^ this way of checking doesn't require a circular import
|
||||
# valid is already an instance of a python-stix2 class; no need
|
||||
# to turn it into a dictionary and then pass it to the class
|
||||
|
|
|
@ -1095,11 +1095,11 @@ def test_process_example_empty_error():
|
|||
|
||||
def test_process_example_empty_with_extensions():
|
||||
with pytest.raises(stix2.exceptions.AtLeastOnePropertyError) as excinfo:
|
||||
stix2.v20.Process(
|
||||
extensions={
|
||||
"windows-process-ext": {},
|
||||
},
|
||||
)
|
||||
stix2.v20.Process(
|
||||
extensions={
|
||||
"windows-process-ext": {},
|
||||
},
|
||||
)
|
||||
|
||||
assert excinfo.value.cls == stix2.v20.WindowsProcessExt
|
||||
properties_of_extension = list(stix2.v20.WindowsProcessExt._properties.keys())
|
||||
|
@ -1127,13 +1127,13 @@ def test_process_example_windows_process_ext():
|
|||
|
||||
def test_process_example_windows_process_ext_empty():
|
||||
with pytest.raises(stix2.exceptions.AtLeastOnePropertyError) as excinfo:
|
||||
stix2.v20.Process(
|
||||
pid=1221,
|
||||
name="gedit-bin",
|
||||
extensions={
|
||||
"windows-process-ext": {},
|
||||
},
|
||||
)
|
||||
stix2.v20.Process(
|
||||
pid=1221,
|
||||
name="gedit-bin",
|
||||
extensions={
|
||||
"windows-process-ext": {},
|
||||
},
|
||||
)
|
||||
|
||||
assert excinfo.value.cls == stix2.v20.WindowsProcessExt
|
||||
properties_of_extension = list(stix2.v20.WindowsProcessExt._properties.keys())
|
||||
|
@ -1142,7 +1142,7 @@ def test_process_example_windows_process_ext_empty():
|
|||
|
||||
def test_process_example_extensions_empty():
|
||||
with pytest.raises(stix2.exceptions.InvalidValueError) as excinfo:
|
||||
stix2.v20.Process(extensions={})
|
||||
stix2.v20.Process(extensions={})
|
||||
|
||||
assert excinfo.value.cls == stix2.v20.Process
|
||||
assert excinfo.value.prop_name == 'extensions'
|
||||
|
|
|
@ -1073,9 +1073,9 @@ def test_process_example_empty_error():
|
|||
|
||||
def test_process_example_empty_with_extensions():
|
||||
with pytest.raises(stix2.exceptions.AtLeastOnePropertyError) as excinfo:
|
||||
stix2.v21.Process(extensions={
|
||||
"windows-process-ext": {},
|
||||
})
|
||||
stix2.v21.Process(extensions={
|
||||
"windows-process-ext": {},
|
||||
})
|
||||
|
||||
assert excinfo.value.cls == stix2.v21.WindowsProcessExt
|
||||
properties_of_extension = list(stix2.v21.WindowsProcessExt._properties.keys())
|
||||
|
@ -1102,12 +1102,12 @@ def test_process_example_windows_process_ext():
|
|||
|
||||
def test_process_example_windows_process_ext_empty():
|
||||
with pytest.raises(stix2.exceptions.AtLeastOnePropertyError) as excinfo:
|
||||
stix2.v21.Process(
|
||||
pid=1221,
|
||||
extensions={
|
||||
"windows-process-ext": {},
|
||||
},
|
||||
)
|
||||
stix2.v21.Process(
|
||||
pid=1221,
|
||||
extensions={
|
||||
"windows-process-ext": {},
|
||||
},
|
||||
)
|
||||
|
||||
assert excinfo.value.cls == stix2.v21.WindowsProcessExt
|
||||
properties_of_extension = list(stix2.v21.WindowsProcessExt._properties.keys())
|
||||
|
@ -1116,7 +1116,7 @@ def test_process_example_windows_process_ext_empty():
|
|||
|
||||
def test_process_example_extensions_empty():
|
||||
with pytest.raises(stix2.exceptions.InvalidValueError) as excinfo:
|
||||
stix2.v21.Process(extensions={})
|
||||
stix2.v21.Process(extensions={})
|
||||
|
||||
assert excinfo.value.cls == stix2.v21.Process
|
||||
assert excinfo.value.prop_name == 'extensions'
|
||||
|
|
Loading…
Reference in New Issue