add big brother readme and test
parent
9790785c08
commit
743e735c48
|
@ -0,0 +1,8 @@
|
||||||
|
# Bigbrother
|
||||||
|
|
||||||
|
Python 3.8+ auditing to detect and block some exploits and privacy leaks
|
||||||
|
|
||||||
|
## Files
|
||||||
|
|
||||||
|
* \_\_init\_\_.py: Contains sys audit hook and py version safe enabler
|
||||||
|
* ministry/: contains functions wrapped by the audit hook to process security events
|
|
@ -0,0 +1,27 @@
|
||||||
|
import sys, os
|
||||||
|
sys.path.append(".")
|
||||||
|
sys.path.append("src/")
|
||||||
|
import unittest, uuid
|
||||||
|
|
||||||
|
import requests
|
||||||
|
|
||||||
|
TEST_DIR = 'testdata/%s-%s' % (uuid.uuid4(), os.path.basename(__file__)) + '/'
|
||||||
|
print("Test directory:", TEST_DIR)
|
||||||
|
os.environ["ONIONR_HOME"] = TEST_DIR
|
||||||
|
from utils import createdirs, identifyhome
|
||||||
|
import onionrsetup as setup
|
||||||
|
import onionrexceptions
|
||||||
|
|
||||||
|
|
||||||
|
createdirs.create_dirs()
|
||||||
|
setup.setup_config()
|
||||||
|
|
||||||
|
class TestBigBrother(unittest.TestCase):
|
||||||
|
def test_requests_connect(self):
|
||||||
|
import bigbrother
|
||||||
|
bigbrother.enable_ministries()
|
||||||
|
with self.assertRaises(onionrexceptions.NetworkLeak):
|
||||||
|
requests.get('https://example.com')
|
||||||
|
|
||||||
|
|
||||||
|
unittest.main()
|
Loading…
Reference in New Issue