From 6b3dd02a577adb17795902265d1172aae3208eab Mon Sep 17 00:00:00 2001 From: Bryan Worrell Date: Sat, 7 Mar 2015 18:23:12 -0500 Subject: [PATCH] Added missing return statement in to_dict() --- stix/test/core/stix_package_test.py | 19 ++++++++----------- stix/ttp/exploit.py | 2 +- stix/ttp/malware_instance.py | 4 ++-- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/stix/test/core/stix_package_test.py b/stix/test/core/stix_package_test.py index f75b03b4..49025e7c 100644 --- a/stix/test/core/stix_package_test.py +++ b/stix/test/core/stix_package_test.py @@ -3,10 +3,7 @@ import unittest -from stix.test import ( - EntityTestCase, campaign_test, coa_test, exploit_target_test, - incident_test, indicator_test, threat_actor_test, ttp_test -) +from stix.test import EntityTestCase from stix.test.common import kill_chains_test from . import stix_header_test @@ -19,7 +16,7 @@ class CampaignsTests(EntityTestCase, unittest.TestCase): klass = stix_package.Campaigns _full_dict = [ - campaign_test.CampaignTest._full_dict + {'idref': 'example:test-1'} ] @@ -27,28 +24,28 @@ class COAsTests(EntityTestCase, unittest.TestCase): klass = stix_package.CoursesOfAction _full_dict = [ - coa_test.COATests._full_dict + {'idref': 'example:test-1'} ] class ExploitTargetsTests(EntityTestCase, unittest.TestCase): klass = stix_package.ExploitTargets _full_dict = [ - exploit_target_test.ExploitTargetTests._full_dict + {'idref': 'example:test-1'} ] class IncidentsTests(EntityTestCase, unittest.TestCase): klass = stix_package.Incidents _full_dict = [ - incident_test.IncidentTest._full_dict + {'idref': 'example:test-1'} ] class IndicatorsTests(EntityTestCase, unittest.TestCase): klass = stix_package.Indicators _full_dict = [ - indicator_test.IndicatorTest._full_dict + {'idref': 'example:test-1'} ] @@ -56,7 +53,7 @@ class ThreatActorsTests(EntityTestCase, unittest.TestCase): klass = stix_package.ThreatActors _full_dict = [ - threat_actor_test.ThreatActorTests._full_dict + {'idref': 'example:test-1'} ] class TTPsTests(EntityTestCase, unittest.TestCase): @@ -65,7 +62,7 @@ class TTPsTests(EntityTestCase, unittest.TestCase): _full_dict = { 'kill_chains': kill_chains_test.KillChainsTests._full_dict, 'ttps': [ - ttp_test.TTPTests._full_dict + {'idref': 'example:test-1'} ] } diff --git a/stix/ttp/exploit.py b/stix/ttp/exploit.py index a874ca39..0d55aaf7 100644 --- a/stix/ttp/exploit.py +++ b/stix/ttp/exploit.py @@ -73,7 +73,7 @@ def from_obj(cls, obj, return_obj=None): return return_obj def to_dict(self): - super(Exploit, self).to_dict() + return super(Exploit, self).to_dict() @classmethod def from_dict(cls, dict_repr, return_obj=None): diff --git a/stix/ttp/malware_instance.py b/stix/ttp/malware_instance.py index 725659d0..14ddaf0e 100644 --- a/stix/ttp/malware_instance.py +++ b/stix/ttp/malware_instance.py @@ -125,8 +125,8 @@ def from_obj(cls, obj, return_obj=None): def to_dict(self): d = utils.to_dict(self) - if getattr(self, '_XSI_TYPE', None): - d['xsi:type'] = self._XSI_TYPE + if getattr(self, '_XSI_TYPE', None): + d['xsi:type'] = self._XSI_TYPE return d