~andreserl/maas/qa-lab-tests-bionic

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from unittest import TestLoader

from common import TestMAASIntegration  # noqa


def get_tests_order():
    suite = open('image-suite')
    tests = [line.strip() for line in suite.readlines()]
    return tests

tests_order = get_tests_order()


def sorting_method(ignored, first_test, second_test):
    return tests_order.index(first_test) - tests_order.index(second_test)


TestLoader.sortTestMethodsUsing = sorting_method