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

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


class TestPackaging(unittest.TestCase):
    def test_mod_00_compute_delta_load_0(self):
        self.assertEqual(mod_00.compute_delta_load_0(199, 281), 94)

    def test_mod_00_compute_lean_margin_1(self):
        self.assertEqual(mod_00.compute_lean_margin_1(71, 260), 147)

    def test_mod_00_compute_rapid_factor_2(self):
        self.assertEqual(mod_00.compute_rapid_factor_2(465, 343), 70)

    def test_mod_01_compute_delta_weight_0(self):
        self.assertEqual(mod_01.compute_delta_weight_0(470, 170), 540)

    def test_mod_01_compute_swift_span_1(self):
        self.assertEqual(mod_01.compute_swift_span_1(257, 254), 49)

    def test_mod_01_compute_delta_factor_2(self):
        self.assertEqual(mod_01.compute_delta_factor_2(75, 152), 35)

    def test_mod_02_compute_solid_factor_0(self):
        self.assertEqual(mod_02.compute_solid_factor_0(425, 197), 31)

    def test_mod_02_compute_swift_weight_1(self):
        self.assertEqual(mod_02.compute_swift_weight_1(375, 454), 394)

    def test_mod_02_compute_batch_load_2(self):
        self.assertEqual(mod_02.compute_batch_load_2(494, 190), 146)

    def test_mod_03_compute_batch_margin_0(self):
        self.assertEqual(mod_03.compute_batch_margin_0(195, 119), 237)

    def test_mod_03_compute_batch_score_1(self):
        self.assertEqual(mod_03.compute_batch_score_1(339, 64), 5)

    def test_mod_03_compute_lean_span_2(self):
        self.assertEqual(mod_03.compute_lean_span_2(407, 99), 90)

    def test_mod_04_compute_stable_score_0(self):
        self.assertEqual(mod_04.compute_stable_score_0(57, 31), 132)

    def test_mod_04_compute_batch_load_1(self):
        self.assertEqual(mod_04.compute_batch_load_1(132, 383), 164)

    def test_mod_04_compute_prime_score_2(self):
        self.assertEqual(mod_04.compute_prime_score_2(455, 257), 301)

    def test_mod_05_compute_rapid_index_0(self):
        self.assertEqual(mod_05.compute_rapid_index_0(438, 93), 119)

    def test_mod_05_compute_swift_weight_1(self):
        self.assertEqual(mod_05.compute_swift_weight_1(457, 155), 413)

    def test_mod_05_compute_delta_index_2(self):
        self.assertEqual(mod_05.compute_delta_index_2(379, 342), 187)

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


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