2019-05-16 16:34:38 +03:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
# You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
2019-05-30 14:25:26 +03:00
|
|
|
from bugbug import model
|
2019-05-16 16:34:38 +03:00
|
|
|
from bugbug.models import MODELS, get_model_class
|
|
|
|
|
|
|
|
|
|
|
|
def test_import_all_models():
|
|
|
|
""" Try loading all defined models to ensure that their full qualified
|
|
|
|
names are still good
|
|
|
|
"""
|
|
|
|
|
|
|
|
for model_name in MODELS.keys():
|
|
|
|
print("Try loading model", model_name)
|
|
|
|
get_model_class(model_name)
|
2019-05-30 14:25:26 +03:00
|
|
|
|
|
|
|
|
|
|
|
def test_component_is_bugmodel():
|
|
|
|
model_class = get_model_class("component")
|
2019-05-30 19:55:22 +03:00
|
|
|
assert issubclass(model_class, model.BugModel)
|
|
|
|
model_class = get_model_class("regression")
|
|
|
|
assert issubclass(model_class, model.BugModel)
|
2019-05-30 14:25:26 +03:00
|
|
|
|
|
|
|
|
|
|
|
def test_backout_is_commitmodel():
|
|
|
|
model_class = get_model_class("backout")
|
2019-05-30 19:55:22 +03:00
|
|
|
assert issubclass(model_class, model.CommitModel)
|