|
@@ -102,7 +102,7 @@ class efactTest(unittest.TestCase):
|
|
# self.efactoauth.validate_invoice(os.path.join(root, file))
|
|
# self.efactoauth.validate_invoice(os.path.join(root, file))
|
|
self.efactoauth.validate_invoice('c:/Users/DECEL/FACT1/MZK/2023_01_03/MZK2414.xml')
|
|
self.efactoauth.validate_invoice('c:/Users/DECEL/FACT1/MZK/2023_01_03/MZK2414.xml')
|
|
|
|
|
|
- def test_renamer(self, dir_path, kind: Union[str, 'seller', 'buyer']): # @UndefinedVariable
|
|
|
|
|
|
+ def test_rename_all(self, dir_path, kind: Union[str, 'seller', 'buyer']): # @UndefinedVariable
|
|
if kind == 'seller':
|
|
if kind == 'seller':
|
|
account = 'AccountingCustomerParty'
|
|
account = 'AccountingCustomerParty'
|
|
# print(os.path.basename(dir_path))
|
|
# print(os.path.basename(dir_path))
|
|
@@ -143,9 +143,15 @@ class efactTest(unittest.TestCase):
|
|
seventh_part = path_parts[7] if len(path_parts) > 6 else None
|
|
seventh_part = path_parts[7] if len(path_parts) > 6 else None
|
|
# print(seventh_part)
|
|
# print(seventh_part)
|
|
if seventh_part != os.path.basename(dir_path):
|
|
if seventh_part != os.path.basename(dir_path):
|
|
|
|
+ #
|
|
|
|
+ # !This will rename all files
|
|
|
|
+ #
|
|
# os.rename(current_path, new_path)
|
|
# os.rename(current_path, new_path)
|
|
print(new_name)
|
|
print(new_name)
|
|
else:
|
|
else:
|
|
|
|
+ #
|
|
|
|
+ # !This will rename all files
|
|
|
|
+ #
|
|
# os.rename(current_path, new_path)
|
|
# os.rename(current_path, new_path)
|
|
print(new_name)
|
|
print(new_name)
|
|
|
|
|
|
@@ -154,6 +160,6 @@ if __name__ == "__main__":
|
|
# unittest.main()
|
|
# unittest.main()
|
|
# efactTest().test_add_invoice()
|
|
# efactTest().test_add_invoice()
|
|
# efactTest().test_get_all_messages()
|
|
# efactTest().test_get_all_messages()
|
|
- # efactTest().test_renamer('c:/Users/levi/git/anafapi/tests/17259191/', kind='seller')
|
|
|
|
- efactTest().test_renamer('/home/deeejas/git/anafapi/tests/17259191', kind='buyer')
|
|
|
|
|
|
+ # efactTest().test_rename_all('c:/Users/levi/git/anafapi/tests/17259191/', kind='seller')
|
|
|
|
+ efactTest().test_rename_all('/home/deeejas/git/anafapi/tests/17259191', kind='buyer')
|
|
# anoauth.get_token()
|
|
# anoauth.get_token()
|