mirror of
https://github.com/MattKeeley/Spoofy.git
synced 2026-02-03 13:33:24 +00:00
Update test.py
This commit is contained in:
32
test.py
32
test.py
@@ -1,5 +1,5 @@
|
||||
import unittest
|
||||
from modules import logic
|
||||
from modules.spoofing import Spoofing
|
||||
|
||||
class TestSpoofy(unittest.TestCase):
|
||||
|
||||
@@ -16,34 +16,44 @@ class TestSpoofy(unittest.TestCase):
|
||||
'''
|
||||
|
||||
def test_spoofing_is_possible(self):
|
||||
unittest.TestCase().assertEqual(logic.is_spoofable('test_0.com', 'none', 'r', 'v=spf1 include:fake.gov', '~all', 3, None, 100), 0)
|
||||
spoofing = Spoofing('test_0.com', 'none', 'r', 'v=spf1 include:fake.gov', '~all', 3, None, 100)
|
||||
self.assertEqual(spoofing.spoofable, 0)
|
||||
|
||||
def test_subdomain_spoofing(self):
|
||||
unittest.TestCase().assertEqual(logic.is_spoofable("test_1.com", 'reject', None, 'v=spf1 include:fakest.domain.com', '-all', 3, 'none', None), 1)
|
||||
spoofing = Spoofing("test_1.com", 'reject', None, 'v=spf1 include:fakest.domain.com', '-all', 3, 'none', None)
|
||||
self.assertEqual(spoofing.spoofable, 1)
|
||||
|
||||
def test_organizational_domain_spoofing(self):
|
||||
unittest.TestCase().assertEqual(logic.is_spoofable('test_2.com', 'none', 'r', 'v=spf1 include:fakest.domain.com include:faker.domain.com', '-all', 2, 'reject', 100), 2)
|
||||
spoofing = Spoofing('test_2.com', 'none', 'r', 'v=spf1 include:fakest.domain.com include:faker.domain.com', '-all', 2, 'reject', 100)
|
||||
self.assertEqual(spoofing.spoofable, 2)
|
||||
|
||||
def test_spoofing_might_be_possible(self):
|
||||
unittest.TestCase().assertEqual(logic.is_spoofable('test_3.com', 'none', None, 'v=spf1 include:fakest.domain.com', '~all', 1, 'quarantine', 90), 3)
|
||||
spoofing = Spoofing('test_3.com', 'none', None, 'v=spf1 include:fakest.domain.com', '~all', 1, 'quarantine', 90)
|
||||
self.assertEqual(spoofing.spoofable, 3)
|
||||
|
||||
def test_spoofing_might_be_possible_mbd(self):
|
||||
unittest.TestCase().assertEqual(logic.is_spoofable('test_4.com', 'none', None, 'v=spf1 include:fakest.domain.com', '-all', 1, None, 100), 4)
|
||||
spoofing = Spoofing('test_4.com', 'none', None, 'v=spf1 include:fakest.domain.com', '-all', 1, None, 100)
|
||||
self.assertEqual(spoofing.spoofable, 4)
|
||||
|
||||
def test_org_domain_spoofing_might_be_possible(self):
|
||||
unittest.TestCase().assertEqual(logic.is_spoofable('test_5.com', 'none', None, 'v=spf1 include:fakest.domain.com', '-all', 1, 'reject', 100), 5)
|
||||
spoofing = Spoofing('test_5.com', 'none', None, 'v=spf1 include:fakest.domain.com', '-all', 1, 'reject', 100)
|
||||
self.assertEqual(spoofing.spoofable, 5)
|
||||
|
||||
def test_subdomain_spoofing_might_be_possible_mbd(self):
|
||||
unittest.TestCase().assertEqual(logic.is_spoofable('test_6.com', 'reject', 'r', 'v=spf1 include:fakest.domain.com', '?all', 1, 'none', 100), 6)
|
||||
spoofing = Spoofing('test_6.com', 'reject', 'r', 'v=spf1 include:fakest.domain.com', '?all', 1, 'none', 100)
|
||||
self.assertEqual(spoofing.spoofable, 6)
|
||||
|
||||
def test_subdomain_spoofing_and_org_spoofing_might_be_possible(self):
|
||||
unittest.TestCase().assertEqual(logic.is_spoofable('test_7.com', 'none', None, 'v=spf1 include:fakest.domain.com', '~all', 3, 'none', 100), 7)
|
||||
spoofing = Spoofing('test_7.com', 'none', None, 'v=spf1 include:fakest.domain.com', '~all', 3, 'none', 100)
|
||||
self.assertEqual(spoofing.spoofable, 7)
|
||||
|
||||
def test_spoofing_not_possible(self):
|
||||
unittest.TestCase().assertEqual(logic.is_spoofable('test_8.com', 'none', 's', 'v=spf1 include:fakest.domain.com', '~all', 1, 'quarantine', 100), 8)
|
||||
spoofing = Spoofing('test_8.com', 'none', 's', 'v=spf1 include:fakest.domain.com', '~all', 1, 'quarantine', 100)
|
||||
self.assertEqual(spoofing.spoofable, 8)
|
||||
|
||||
def test_possible_bug_fix1(self):
|
||||
unittest.TestCase().assertEqual(logic.is_spoofable('sub.test_9.com', None, None, None, None, None, None, None), 0)
|
||||
spoofing = Spoofing('sub.test_9.com', None, None, None, None, None, None, None)
|
||||
self.assertEqual(spoofing.spoofable, 0)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user