render-generator-backend/test/test_generate_lamp.py

28 lines
748 B
Python
Raw Normal View History

2017-10-20 11:30:47 +00:00
import os
import sys
import random
import json
import product_gen.generate_product
from argparse import ArgumentParser
2017-10-20 11:30:47 +00:00
if __name__ == "__main__":
shape = "pendant"
output = "test"
if not os.path.exists(os.getcwd() + "/" + output):
os.makedirs(os.getcwd() + "/" + output)
height = 1.5
radius = 0.5
color = [0.1, 0.1, 0.1]
product_gen.generate_product.generate(shape, height, radius, color, output)
2017-10-20 11:30:47 +00:00
shape_parameters = {"shape": shape,
"height": height,
"radius": radius,
"color": color}
with open(os.getcwd() + "/" + output + "/"+ output + '.json', 'w') as outfile:
json.dump(shape_parameters, outfile)