mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-22 08:53:06 +01:00
Analyzer CI
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
def main():
|
||||
print('{"result":{ "requestId": "something-generated-by-whois", "someother_field": "more data" }, "summary": "botsrv.btc-goblin.ru"}')
|
||||
print('{"result":{ "requestId": "something-generated-by-whois", "someother_field": "more data" }, "summary": "botsrv.btc-goblin.ru"}')
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
main()
|
||||
|
||||
@@ -3,10 +3,11 @@ from unittest.mock import patch
|
||||
from whois import whois
|
||||
import unittest
|
||||
|
||||
|
||||
class TestWhoisMethods(unittest.TestCase):
|
||||
|
||||
def test_main(self):
|
||||
with patch('sys.stdout', new = StringIO()) as mock_stdout:
|
||||
with patch('sys.stdout', new=StringIO()) as mock_stdout:
|
||||
whois.main()
|
||||
expected = '{"result":{ "requestId": "something-generated-by-whois", "someother_field": "more data" }, "summary": "botsrv.btc-goblin.ru"}\n'
|
||||
self.assertEqual(mock_stdout.getvalue(), expected)
|
||||
|
||||
Reference in New Issue
Block a user