mirror of https://github.com/MISP/misp-modules
fix: Removed unused self param turning the associated functions into static methods
parent
e1602fdca9
commit
93858e302a
|
@ -21,21 +21,24 @@ class TestExpansions(unittest.TestCase):
|
|||
def misp_modules_post(self, query):
|
||||
return requests.post(urljoin(self.url, "query"), json=query)
|
||||
|
||||
def get_data(self, response):
|
||||
@staticmethod
|
||||
def get_data(response):
|
||||
data = response.json()
|
||||
if not isinstance(data, dict):
|
||||
print(json.dumps(data, indent=2))
|
||||
return data
|
||||
return data['results'][0]['data']
|
||||
|
||||
def get_errors(self, response):
|
||||
@staticmethod
|
||||
def get_errors(response):
|
||||
data = response.json()
|
||||
if not isinstance(data, dict):
|
||||
print(json.dumps(data, indent=2))
|
||||
return data
|
||||
return data['error']
|
||||
|
||||
def get_values(self, response):
|
||||
@staticmethod
|
||||
def get_values(response):
|
||||
data = response.json()
|
||||
if not isinstance(data, dict):
|
||||
print(json.dumps(data, indent=2))
|
||||
|
|
Loading…
Reference in New Issue