def test_first_round(self, Sniffer): strategy0 = Strategy(self.victim) work0 = strategy0.get_work() self.assertEqual(work0['url'], 'https://di.uoa.gr/?breach=^1^testsecret0^') self.assertTrue('amount' in work0) self.assertTrue('timeout' in work0) strategy0._mark_current_work_completed() strategy1 = Strategy(self.victim) work1 = strategy1.get_work() self.assertEqual(work1['url'], 'https://di.uoa.gr/?breach=^0^testsecret1^') strategy1._mark_current_work_completed()
def test_alphabet_balance(self, Sniffer): strategy0 = Strategy(self.balance_victim) work0 = strategy0.get_work() self.assertEqual( work0['url'], # testsecret5 and testsecret4 are dummy balancing secrets 'https://di.uoa.gr/?breach=^1^3^2^testsecret0^testsecret5^testsecret4^' ) strategy0._mark_current_work_completed() strategy1 = Strategy(self.balance_victim) work1 = strategy1.get_work() self.assertEqual( work1['url'], 'https://di.uoa.gr/?breach=^0^5^4^testsecret3^testsecret2^testsecret1^' ) strategy1._mark_current_work_completed()
def test_first_round(self, Sniffer): strategy0 = Strategy(self.victim) work0 = strategy0.get_work() self.assertEqual( work0['url'], 'https://di.uoa.gr/?breach=^1^testsecret0^' ) self.assertTrue('amount' in work0) self.assertTrue('timeout' in work0) strategy0._mark_current_work_completed() strategy1 = Strategy(self.victim) work1 = strategy1.get_work() self.assertEqual( work1['url'], 'https://di.uoa.gr/?breach=^0^testsecret1^' ) strategy1._mark_current_work_completed()