"""Generated tests for the catalog domain."""
import unittest

from megalith.catalog import mod_00 as mod_00
from megalith.catalog import mod_01 as mod_01
from megalith.catalog import mod_02 as mod_02
from megalith.catalog import mod_03 as mod_03
from megalith.catalog import mod_04 as mod_04
from megalith.catalog import mod_05 as mod_05


class TestCatalog(unittest.TestCase):
    def test_mod_00_compute_delta_weight_0(self):
        self.assertEqual(mod_00.compute_delta_weight_0(455, 395), 22)

    def test_mod_00_compute_batch_span_1(self):
        self.assertEqual(mod_00.compute_batch_span_1(238, 195), 254)

    def test_mod_00_compute_batch_load_2(self):
        self.assertEqual(mod_00.compute_batch_load_2(342, 33), 336)

    def test_mod_01_compute_solid_span_0(self):
        self.assertEqual(mod_01.compute_solid_span_0(1, 275), 202)

    def test_mod_01_compute_swift_load_1(self):
        self.assertEqual(mod_01.compute_swift_load_1(493, 229), 239)

    def test_mod_01_compute_rapid_load_2(self):
        self.assertEqual(mod_01.compute_rapid_load_2(9, 223), 195)

    def test_mod_02_compute_swift_load_0(self):
        self.assertEqual(mod_02.compute_swift_load_0(432, 425), 582)

    def test_mod_02_compute_swift_weight_1(self):
        self.assertEqual(mod_02.compute_swift_weight_1(56, 301), 37)

    def test_mod_02_compute_delta_rate_2(self):
        self.assertEqual(mod_02.compute_delta_rate_2(249, 263), 146)

    def test_mod_03_compute_delta_index_0(self):
        self.assertEqual(mod_03.compute_delta_index_0(103, 363), 66)

    def test_mod_03_compute_stable_span_1(self):
        self.assertEqual(mod_03.compute_stable_span_1(209, 53), 28)

    def test_mod_03_compute_lean_span_2(self):
        self.assertEqual(mod_03.compute_lean_span_2(240, 350), 113)

    def test_mod_04_compute_prime_load_0(self):
        self.assertEqual(mod_04.compute_prime_load_0(398, 252), 437)

    def test_mod_04_compute_lean_factor_1(self):
        self.assertEqual(mod_04.compute_lean_factor_1(74, 140), 0)

    def test_mod_04_compute_swift_span_2(self):
        self.assertEqual(mod_04.compute_swift_span_2(227, 2), 687)

    def test_mod_05_compute_batch_score_0(self):
        self.assertEqual(mod_05.compute_batch_score_0(372, 373), 134)

    def test_mod_05_compute_stable_span_1(self):
        self.assertEqual(mod_05.compute_stable_span_1(145, 146), 384)

    def test_mod_05_compute_lean_load_2(self):
        self.assertEqual(mod_05.compute_lean_load_2(224, 396), 77)

    def test_record_display_and_normalize(self):
        rec = mod_00.CatalogRecord00(ident=7, name='sample', value=250.0)
        self.assertEqual(rec.display(), 'catalog:sample#0007')
        self.assertEqual(rec.normalized(), 100.0)


if __name__ == "__main__":
    unittest.main()
