Skip to content

Commit

Permalink
Added missing return statement in to_dict()
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryan Worrell committed Mar 7, 2015
1 parent 5ebf1a5 commit 6b3dd02
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
19 changes: 8 additions & 11 deletions stix/test/core/stix_package_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -19,44 +16,44 @@ class CampaignsTests(EntityTestCase, unittest.TestCase):
klass = stix_package.Campaigns

_full_dict = [
campaign_test.CampaignTest._full_dict
{'idref': 'example:test-1'}
]


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'}
]


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):
Expand All @@ -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'}
]
}

Expand Down
2 changes: 1 addition & 1 deletion stix/ttp/exploit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions stix/ttp/malware_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 6b3dd02

Please sign in to comment.