Skip to content

Commit ea55b48

Browse files
committed
[fix] update tests
1 parent e85ce7c commit ea55b48

29 files changed

+123
-83
lines changed

tests/test_array_parse.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
import unittest
22

3-
from src.csv_to_custom_json.csv_to_custom_json import parseFile
3+
from src.csv_to_custom_json import parseFile
4+
45

56
class Test(unittest.TestCase):
67
def test_array_parse(self):
78
def function1(allValues):
89
mystring = 'toto{}'.format(','.join(map(str, allValues)))
910
return mystring
11+
1012
def function2(uselessArg):
1113
return "arrow"
1214
test = parseFile("./tests/simple_complexe.csv", [
13-
"num4",
14-
"text",
15-
function1,
16-
function2
17-
], {
15+
"num4",
16+
"text",
17+
function1,
18+
function2
19+
], {
1820
"arrayParse": False
1921
})
2022
self.assertEqual(test, [
@@ -36,4 +38,4 @@ def function2(uselessArg):
3638
"toto7,8,9,10",
3739
"arrow"
3840
]
39-
])
41+
])

tests/test_avoidVoidLine.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import unittest
22

3-
from src.csv_to_custom_json.csv_to_custom_json import parseFile
3+
from src.csv_to_custom_json import parseFile
4+
45

56
class Test(unittest.TestCase):
67
def test_array_parse(self):
78
def function1(allValues):
89
mystring = 'toto{}'.format(','.join(map(str, allValues)))
910
return mystring
11+
1012
def function2(uselessArg):
1113
return "arrow"
1214
test = parseFile("./tests/simple_complexe_with_void_line.csv", [

tests/test_avoidVoidLine2.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import unittest
22

3-
from src.csv_to_custom_json.csv_to_custom_json import parseFile
3+
from src.csv_to_custom_json import parseFile
4+
45

56
class Test(unittest.TestCase):
67
def test_array_parse(self):
78
def function1(allValues):
89
mystring = 'toto{}'.format(','.join(map(str, allValues)))
910
return mystring
11+
1012
def function2(uselessArg):
1113
return "arrow"
1214
test = parseFile("./tests/simple_complexe_with_void_line.csv", [

tests/test_avoidVoidLine3.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import unittest
22

3-
from src.csv_to_custom_json.csv_to_custom_json import parseFile
3+
from src.csv_to_custom_json import parseFile
4+
45

56
class Test(unittest.TestCase):
67
def test_array_parse(self):
78
def function1(allValues):
89
mystring = 'toto{}'.format(','.join(map(str, allValues)))
910
return mystring
11+
1012
def function2(uselessArg):
1113
return "arrow"
1214
test = parseFile([
@@ -98,4 +100,4 @@ def function2(uselessArg):
98100
"num1": 7
99101
}
100102
]
101-
])
103+
])

tests/test_callBack_force.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import unittest
22

3-
from src.csv_to_custom_json.csv_to_custom_json import parseFile
3+
from src.csv_to_custom_json import parseFile
4+
45

56
class Test(unittest.TestCase):
67
def test_callBack_force(self):
78
def function1(values):
89
return None
10+
911
def function2(useless, useless2):
1012
return None
1113
test = parseFile("./tests/simple.csv", {
@@ -32,4 +34,4 @@ def function2(useless, useless2):
3234
"num2": None,
3335
"num3": "9"
3436
}
35-
])
37+
])

tests/test_callBack_force_2.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
import unittest
22

3-
from src.csv_to_custom_json.csv_to_custom_json import parseFile
3+
from src.csv_to_custom_json import parseFile
4+
45

56
class Test(unittest.TestCase):
67
def test_callBack_force_2(self):
78
def function1(values):
89
return None
10+
911
def function2(useless, useless2):
1012
return None
1113
test = parseFile("./tests/simple.csv", {
1214
"num1": "string",
1315
"num2": function1,
1416
"num3": "string"
1517
}, {
16-
"callBackForce": True,
17-
"lineCallBack": function2
18+
"callBackForce": True,
19+
"lineCallBack": function2
1820
})
1921
self.assertEqual(test, [
2022
None,
2123
None,
2224
None
23-
])
25+
])

tests/test_complex_json.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import unittest
22

3-
from src.csv_to_custom_json.csv_to_custom_json import parseFile
3+
from src.csv_to_custom_json import parseFile
4+
45

56
class Test(unittest.TestCase):
67
def test_complex_json(self):
@@ -33,4 +34,4 @@ def test_complex_json(self):
3334
"num2": "8",
3435
"num3": "9"
3536
}
36-
])
37+
])

tests/test_complex_json_10.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import unittest
22

3-
from src.csv_to_custom_json.csv_to_custom_json import parseFile
3+
from src.csv_to_custom_json import parseFile
4+
45

56
class Test(unittest.TestCase):
67
def test_complex_json_10(self):
78
def function1(allValues):
89
mystring = 'toto{}'.format(','.join(map(str, allValues)))
910
return mystring
11+
1012
def function2(uselessArg):
1113
return "arrow"
1214
test = parseFile("./tests/simple_complexe.csv", [
@@ -50,4 +52,4 @@ def function2(uselessArg):
5052
"num1": 7
5153
}
5254
]
53-
])
55+
])

tests/test_complex_json_11.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import unittest
22

3-
from src.csv_to_custom_json.csv_to_custom_json import parseFile
3+
from src.csv_to_custom_json import parseFile
4+
45

56
class Test(unittest.TestCase):
67
def test_complex_json_11(self):
78
def function1(allValues):
89
mystring = 'toto{}'.format(','.join(map(str, allValues)))
910
return mystring
11+
1012
def function2(uselessArg):
1113
return "arrow"
1214
test = parseFile("./tests/simple_complexe.csv", [
@@ -90,4 +92,4 @@ def function2(uselessArg):
9092
"num1": 7
9193
}
9294
]
93-
])
95+
])

tests/test_complex_json_2.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import unittest
22

3-
from src.csv_to_custom_json.csv_to_custom_json import parseFile
3+
from src.csv_to_custom_json import parseFile
4+
45

56
class Test(unittest.TestCase):
67
def test_complex_json_2(self):
@@ -41,4 +42,4 @@ def test_complex_json_2(self):
4142
"num2": "8",
4243
"num3": "9"
4344
}
44-
])
45+
])

0 commit comments

Comments
 (0)