Fix unit tests

This commit is contained in:
Daniel Egger 2024-06-04 15:08:29 +02:00
parent 2f8d5312eb
commit fde9af0595
1 changed files with 4 additions and 4 deletions

View File

@ -44,7 +44,7 @@ class AbacusSftpServerTestCase(BaseAbacusSftpServerTestCase):
def test_canWriteFile_toFakeSftpServer(self): def test_canWriteFile_toFakeSftpServer(self):
with AbacusSftpClient() as client: with AbacusSftpClient() as client:
files = client.listdir(".") files = client.listdir(".")
self.assertEqual(["debitor", "order"], files) self.assertSetEqual({"debitor", "order"}, set(files))
str_file = StringIO() str_file = StringIO()
str_file.write("Hello world\n") str_file.write("Hello world\n")
@ -52,7 +52,7 @@ class AbacusSftpServerTestCase(BaseAbacusSftpServerTestCase):
client.putfo(str_file, "hello.txt") client.putfo(str_file, "hello.txt")
files = client.listdir(".") files = client.listdir(".")
self.assertEqual({"debitor", "order", "hello.txt"}, set(files)) self.assertSetEqual({"debitor", "order", "hello.txt"}, set(files))
class AbacusInvoiceUploadTestCase(BaseAbacusSftpServerTestCase): class AbacusInvoiceUploadTestCase(BaseAbacusSftpServerTestCase):
@ -117,14 +117,14 @@ class AbacusInvoiceUploadTestCase(BaseAbacusSftpServerTestCase):
feuz_checkout_info.refresh_from_db() feuz_checkout_info.refresh_from_db()
self.assertTrue(feuz_checkout_info.abacus_ssh_upload_done) self.assertTrue(feuz_checkout_info.abacus_ssh_upload_done)
# calling `abacus_ssh_upload` a second time will not upload order file again... # calling `abacus_ssh_upload` a second time will not upload files again...
os.remove(debitor_filepath) os.remove(debitor_filepath)
os.remove(order_filepath) os.remove(order_filepath)
abacus_ssh_upload(feuz_checkout_info) abacus_ssh_upload(feuz_checkout_info)
debitor_filepath = self.tmppath + "/debitor/myVBV_debi_60000012.xml" debitor_filepath = self.tmppath + "/debitor/myVBV_debi_60000012.xml"
self.assertTrue(os.path.exists(debitor_filepath)) self.assertFalse(os.path.exists(debitor_filepath))
order_filepath = ( order_filepath = (
self.tmppath + "/order/myVBV_orde_60000012_20240215083312_6000000124.xml" self.tmppath + "/order/myVBV_orde_60000012_20240215083312_6000000124.xml"