From 09597561bcee99a9ebd7205efac2b4efdb71c406 Mon Sep 17 00:00:00 2001 From: "helmi.nour" Date: Wed, 24 May 2023 12:57:22 +0100 Subject: [PATCH 1/2] add mocked exec async test --- railib/api.py | 2 +- test/multipart.data | Bin 0 -> 1912 bytes test/test_integration.py | 39 ++++++++++++++++++++++++++++++++++++++- 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 test/multipart.data diff --git a/railib/api.py b/railib/api.py index 8e28b72..22243ca 100644 --- a/railib/api.py +++ b/railib/api.py @@ -270,7 +270,7 @@ def _parse_multipart_form( txn_file.name = name.group(1).decode() filename = re.match(b'.*filename="(.+?)"', disposition) if not (filename is None): - txn_file.filename = name.group(1).decode() + txn_file.filename = filename.group(1).decode() result.append(txn_file) diff --git a/test/multipart.data b/test/multipart.data new file mode 100644 index 0000000000000000000000000000000000000000..4bd88bc6f95a8d6f68525bcdbc74779eceda099e GIT binary patch literal 1912 zcmb_c&2G~`5Z*L_nk7b2R8T57M0?`Erg457SD;F550yX^skf@C*7imOCAP6Qp{Vo) zc!C}|aNt3B1m362*t;rCm8wOVYIb&JKF@wLyD8_MAoLv<- z{2EKQF5-AR@&y7nKBZA;Q=6W#QNUc*^JFmW_kF(E>JIqO4YxcYW zd&Lq7M8Z^_APJ#PW->|fSeLaL%|-_hsS-+pzw`dx!P~vVyA&P z9%kqbAf%#eZ01t8y|`1JeeO-+VcV3xp>4Wu71>i-vI><-)uxZF%J;&<{8qBy%FVU9 z+H8mT7P%^4Veljc?GxbEcMl2qofCLE3;V`G(;@?k20TDBUOnM z6CC^{h*cn@LQp6vgIc5nYaT1W-hw}pSzL4d2{r)jX#X43!5Vp;6|x3d=a9Q)UtZ{%rJfd`at8*;Pe*BOPw&*;EZqVfk|j Date: Wed, 24 May 2023 13:21:16 +0100 Subject: [PATCH 2/2] update db & engine --- test/test_integration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_integration.py b/test/test_integration.py index 194a89e..a5def69 100644 --- a/test/test_integration.py +++ b/test/test_integration.py @@ -90,7 +90,7 @@ def test_v2_exec_mocked(self, mock_urlopen): # run the current test cmd = "x, x^2, x^3, x^4 from x in {1; 2; 3; 4; 5}" - rsp = api.exec_async(ctx, dbname, engine, cmd) + rsp = api.exec_async(ctx, "mocked_db", "mocked_engine", cmd) # transaction self.assertEqual("COMPLETED", rsp.transaction["state"])