-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjoins
executable file
·34 lines (28 loc) · 1.22 KB
/
joins
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env python3
import os
import shutil
import filecmp
import unittest
import subprocess
from glob import glob
class JoinsTests(unittest.TestCase):
def test_generate(self):
EXPECTED = b"Generating scenario's instances:\n \xe2\x9c\x85 1-1 0%\n \xe2\x9c\x85 1-1 50%\n \xe2\x9c\x85 1-1 100%\n"
shutil.rmtree('RMLStreamer', ignore_errors=True)
CMD = ['../exgentool', '--root', '.', '--scenario',
'data/tests-joins.json', 'generate']
output = subprocess.check_output(CMD)
# self.assertEqual(output, EXPECTED)
self.assertTrue(len(glob('RMLStreamer/csv/*/data*.csv')) > 0)
for f in glob('RMLStreamer/csv/*_perc/data*.csv'):
result = filecmp.cmp(f, os.path.join('data', 'tests-joins', f))
self.assertTrue(result)
shutil.rmtree('RMLStreamer', ignore_errors=True)
def test_list(self):
EXPECTED = b"Scenario's instances:\n 1. 1-1 0%\n 2. 1-1 50%\n 3. 1-1 100%\n"
CMD = ['../exgentool', '--root', '.', '--scenario',
'data/tests-joins.json', 'list']
output = subprocess.check_output(CMD)
# self.assertEqual(output, EXPECTED)
if __name__ == '__main__':
unittest.main()