forked from nchammas/flintrock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_core.py
37 lines (33 loc) · 1.06 KB
/
test_core.py
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
35
36
37
import os
import pytest
# Flintrock
from flintrock.core import (
generate_template_mapping,
get_formatted_template,
)
FLINTROCK_ROOT_DIR = (
os.path.dirname(
os.path.dirname(
os.path.realpath(__file__))))
@pytest.mark.parametrize(
'spark_version', [
(''),
('3.0.1'),
('0626b11147133b67b26a04b4819f61a33dd958d3'),
])
def test_templates(dummy_cluster, spark_version):
template_dir = os.path.join(FLINTROCK_ROOT_DIR, 'flintrock', 'templates')
for (dirpath, dirnames, filenames) in os.walk(template_dir):
if filenames:
for filename in filenames:
template_path = os.path.join(dirpath, filename)
mapping = generate_template_mapping(
cluster=dummy_cluster,
hadoop_version='',
spark_version=spark_version,
spark_executor_instances=0,
)
get_formatted_template(
path=template_path,
mapping=mapping,
)