def setUp(self): self.tva = 0.1 self.client = ClientFactory() self.product_lines = [ ProductLineFactory() for i in range(random.randint(1, 10)) ] self.facture = Facture.Facture(self.tva, self.client, self.product_lines)
def run(cls): fac = Facture("PC Store - 22 novembre", cls.articles) print(fac)
print("You need to put all of the arguments (invoice file, signed check and client's Pk)") sys.exit() # file opening try: invoice_file = open(sys.argv[1], 'r') signedcheck_file = open(sys.argv[2], 'r') except (OSError, IOError) as error: print("Error reading file : ", error) sys.exit() fileutils = FileUtils() rsatools = RSAtools() #Getting the infos from the files clepub_client = fileutils.recupKey(sys.argv[3]) facture = Facture(sys.argv[1]) clepub_merchant_original = fileutils.recupKey("commercantPk") bankPk = fileutils.recupKey("banquePk") merchantkeyclientciphered = [] clientkeybanqueciphered = [] merchantkeyclientciphered.append( fileutils.readKey(sys.argv[2],0)) merchantkeyclientciphered.append( fileutils.readKey(sys.argv[2],1)) clientkeybanqueciphered.append(fileutils.readKey(sys.argv[2],2)) clientkeybanqueciphered.append(fileutils.readKey(sys.argv[2],3)) uid_ciphered = fileutils.readKey(sys.argv[2],4) sum_ciphered = fileutils.readKey(sys.argv[2],5)