X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=tests%2Ftest_ad.py;h=cb0a73a18c3277873f51ca4bc593c09621847424;hb=refs%2Fheads%2Fh-release;hp=c60c9dc4102c3e737c5e8ceb092f492bb5eca996;hpb=588acf17f5f14399b2bad62bda8106fef7dac063;p=ric-app%2Fad.git diff --git a/tests/test_ad.py b/tests/test_ad.py index c60c9dc..cb0a73a 100644 --- a/tests/test_ad.py +++ b/tests/test_ad.py @@ -13,21 +13,24 @@ # See the License for the specific language governing permissions and # limitations under the License. # ================================================================================== -from ad import main +import json +from src import main from ricxappframe.xapp_frame import Xapp from contextlib import suppress -import os -from ad.ad_train import train -import json -def test_RFtrainmodel(monkeypatch): - if not os.path.isfile('ad/RF'): - train() +def test_database_connection(monkeypatch): + # start ad + main.connectdb(thread=True) + + +def test_trainModel(monkeypatch): + main.train_model() -def test_predict_anomaly(monkeypatch): - main.predict_anomaly('test') +def test_predict_anomaly(monkeypatch, ad_ue): + main.load_model() + main.predict_anomaly(monkeypatch, ad_ue) def test_msg_to_ts(monkeypatch, ad_to_ts):