Commit 6abb9e5d authored by dasharatha.vamshi's avatar dasharatha.vamshi

py-test

parent 461e5210
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
"current_model": { "current_model": {
"model_name": "randomforest", "model_name": "randomforest",
"model_params": null, "model_params": null,
"training_date": "2021-03-11", "training_date": "2021-03-12",
"framework": null, "framework": null,
"serializedObjectType": "pkl", "serializedObjectType": "pkl",
"model_fl_name": "model_78a80044.pkl" "model_fl_name": "model_da4ccf80_ab258458_6025cc0e_bef1840c_e6a3ee66_1a517dec_05dbb188_53901b54.pkl"
}, },
"archived": [ "archived": [
{ {
...@@ -17,6 +17,94 @@ ...@@ -17,6 +17,94 @@
"framework": null, "framework": null,
"serializedObjectType": "pkl", "serializedObjectType": "pkl",
"model_fl_name": "model_48956f4d.pkl" "model_fl_name": "model_48956f4d.pkl"
},
{
"model_name": "randomforest",
"model_params": null,
"training_date": "2021-03-11",
"framework": null,
"serializedObjectType": "pkl",
"model_fl_name": "model_78a80044.pkl"
},
{
"model_name": "randomforest",
"model_params": null,
"training_date": "2021-03-12",
"framework": null,
"serializedObjectType": "pkl",
"model_fl_name": "model_e750f617.pkl"
},
{
"model_name": "randomforest",
"model_params": null,
"training_date": "2021-03-12",
"framework": null,
"serializedObjectType": "pkl",
"model_fl_name": "model_bd650614.pkl"
},
{
"model_name": "randomforest",
"model_params": null,
"training_date": "2021-03-12",
"framework": null,
"serializedObjectType": "pkl",
"model_fl_name": "model_bd650614_ba1250bd.pkl"
},
{
"model_name": "randomforest",
"model_params": null,
"training_date": "2021-03-12",
"framework": null,
"serializedObjectType": "pkl",
"model_fl_name": "model_da4ccf80.pkl"
},
{
"model_name": "randomforest",
"model_params": null,
"training_date": "2021-03-12",
"framework": null,
"serializedObjectType": "pkl",
"model_fl_name": "model_da4ccf80_ab258458.pkl"
},
{
"model_name": "randomforest",
"model_params": null,
"training_date": "2021-03-12",
"framework": null,
"serializedObjectType": "pkl",
"model_fl_name": "model_da4ccf80_ab258458_6025cc0e.pkl"
},
{
"model_name": "randomforest",
"model_params": null,
"training_date": "2021-03-12",
"framework": null,
"serializedObjectType": "pkl",
"model_fl_name": "model_da4ccf80_ab258458_6025cc0e_bef1840c.pkl"
},
{
"model_name": "randomforest",
"model_params": null,
"training_date": "2021-03-12",
"framework": null,
"serializedObjectType": "pkl",
"model_fl_name": "model_da4ccf80_ab258458_6025cc0e_bef1840c_e6a3ee66.pkl"
},
{
"model_name": "randomforest",
"model_params": null,
"training_date": "2021-03-12",
"framework": null,
"serializedObjectType": "pkl",
"model_fl_name": "model_da4ccf80_ab258458_6025cc0e_bef1840c_e6a3ee66_1a517dec.pkl"
},
{
"model_name": "randomforest",
"model_params": null,
"training_date": "2021-03-12",
"framework": null,
"serializedObjectType": "pkl",
"model_fl_name": "model_da4ccf80_ab258458_6025cc0e_bef1840c_e6a3ee66_1a517dec_05dbb188.pkl"
} }
] ]
}, },
...@@ -31,5 +119,46 @@ ...@@ -31,5 +119,46 @@
"model_fl_name": "model_faed1e93.pkl" "model_fl_name": "model_faed1e93.pkl"
}, },
"archived": [] "archived": []
},
{
"id": "site-new2",
"current_model": {
"model_name": "randomforest",
"model_params": null,
"training_date": "2021-03-11",
"framework": null,
"serializedObjectType": "pkl",
"model_fl_name": "model_b5d4bc8b.pkl"
},
"archived": []
},
{
"id": "site-v1",
"current_model": {
"model_name": "randomforest",
"model_params": null,
"training_date": "2021-03-12",
"framework": null,
"serializedObjectType": "pkl",
"model_fl_name": "model_2785bcb5_97bea2c9_02661874.pkl"
},
"archived": [
{
"model_name": "randomforest",
"model_params": null,
"training_date": "2021-03-12",
"framework": null,
"serializedObjectType": "pkl",
"model_fl_name": "model_2785bcb5.pkl"
},
{
"model_name": "randomforest",
"model_params": null,
"training_date": "2021-03-12",
"framework": null,
"serializedObjectType": "pkl",
"model_fl_name": "model_2785bcb5_97bea2c9.pkl"
}
]
} }
] ]
\ No newline at end of file
{ {
"ilens_tag_hierarchy": "site-new" "ilens_tag_hierarchy": "site-v1"
} }
\ No newline at end of file
from scripts.common.config_parser import config
from scripts.common.constants import AddtoModelStoreConstants, ComponentExceptions
from scripts.common.logsetup import logger
from sklearn.ensemble import RandomForestRegressor
import pickle
from azure.storage.blob import BlobServiceClient
import os.path
from os import path
from datetime import date
import uuid
import json
import os
from main import AddtoModelStore
def test1():
obj = AddtoModelStore(config)
assert obj.run() == True
def test2():
obj = AddtoModelStore(config)
if obj.run():
with open(config['metadata_file']) as f:
data = json.load(f)
for i in data:
if i['id'] == config['ilens_tag_hierarchy']:
assert i['current_model']['model_fl_name'] == os.listdir(config['component_input_dir'])[0]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment