@@ -0,0 +1,2134 @@
+from django.test import TestCase%0Afrom breach.models import Target, Victim, Round%0A%0A%0Aclass ModelTestCase(TestCase):%0A    def setUp(self):%0A        self.target = Target.objects.create(%0A            endpoint='https://di.uoa.gr/?breach=%25s',%0A            prefix='test',%0A            alphabet='01'%0A        )%0A%0A        self.victim = Victim.objects.create(%0A            target=self.target,%0A            sourceip='0.0.0.0'%0A        )%0A%0A    def test_target(self):%0A        self.assertEqual(self.target.host, 'di.uoa.gr')%0A        self.assertEqual(self.target.port, 443)%0A        self.assertEqual(self.target.samplesize, 64)%0A        self.assertEqual(self.target.confidence_threshold, 1.0)%0A        self.assertEqual(self.target.compression_function_factor, 1.05)%0A        self.assertEqual(self.target.amplification_factor, 1.05)%0A        self.assertTrue(self.target.huffman_pool)%0A        self.assertTrue(self.target.block_align)%0A        self.assertEqual(self.target.method, 1)%0A%0A        self.assertEqual(self.target._meta.get_field('sentinel').max_length, 1)%0A        self.assertTrue(self.target._meta.get_field('name').unique)%0A%0A    def test_victim(self):%0A        self.assertEqual(self.victim.interface, 'wlan0')%0A        self.assertEqual(self.victim.state, 'discovered')%0A        self.assertEqual(self.victim.realtimeurl, 'http://localhost:3031')%0A        self.assertEqual(self.victim.snifferendpoint, 'http://127.0.0.1:9000')%0A        self.assertEqual(self.victim.calibration_wait, 0.0)%0A%0A    def test_round(self):%0A        round1 = Round.objects.create(%0A            victim=self.victim,%0A            knownalphabet='01'%0A        )%0A%0A        self.assertTrue(round1.check_block_align())%0A        round1.block_align = False%0A        self.assertTrue(round1.check_huffman_pool())%0A        round1.huffman_pool = False%0A        self.assertEqual(round1.get_method(), 1)%0A        round1.method = 2%0A%0A        round2 = Round.objects.create(%0A            victim=self.victim,%0A            knownalphabet='01',%0A            index=2%0A        )%0A%0A        self.assertTrue(round2.check_block_align())%0A        self.assertTrue(round2.check_huffman_pool())%0A        self.assertEqual(round2.get_method(), 1)%0A

Add backend target test