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

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


class TestCustoms(unittest.TestCase):
    def test_mod_00_compute_stable_span_0(self):
        self.assertEqual(mod_00.compute_stable_span_0(343, 216), 153)

    def test_mod_00_compute_solid_margin_1(self):
        self.assertEqual(mod_00.compute_solid_margin_1(69, 351), 686)

    def test_mod_00_compute_swift_rate_2(self):
        self.assertEqual(mod_00.compute_swift_rate_2(298, 276), 18)

    def test_mod_01_compute_solid_rate_0(self):
        self.assertEqual(mod_01.compute_solid_rate_0(7, 14), 1)

    def test_mod_01_compute_prime_score_1(self):
        self.assertEqual(mod_01.compute_prime_score_1(172, 93), 67)

    def test_mod_01_compute_rapid_weight_2(self):
        self.assertEqual(mod_01.compute_rapid_weight_2(43, 249), 394)

    def test_mod_02_compute_delta_load_0(self):
        self.assertEqual(mod_02.compute_delta_load_0(70, 110), 24)

    def test_mod_02_compute_prime_factor_1(self):
        self.assertEqual(mod_02.compute_prime_factor_1(272, 445), 11)

    def test_mod_02_compute_batch_weight_2(self):
        self.assertEqual(mod_02.compute_batch_weight_2(231, 166), 379)

    def test_mod_03_compute_batch_factor_0(self):
        self.assertEqual(mod_03.compute_batch_factor_0(54, 142), 128)

    def test_mod_03_compute_solid_index_1(self):
        self.assertEqual(mod_03.compute_solid_index_1(141, 291), 45)

    def test_mod_03_compute_lean_rate_2(self):
        self.assertEqual(mod_03.compute_lean_rate_2(215, 57), 58)

    def test_mod_04_compute_lean_index_0(self):
        self.assertEqual(mod_04.compute_lean_index_0(124, 152), 114)

    def test_mod_04_compute_prime_index_1(self):
        self.assertEqual(mod_04.compute_prime_index_1(366, 151), 481)

    def test_mod_04_compute_rapid_weight_2(self):
        self.assertEqual(mod_04.compute_rapid_weight_2(477, 416), 84)

    def test_mod_05_compute_prime_span_0(self):
        self.assertEqual(mod_05.compute_prime_span_0(447, 285), 127)

    def test_mod_05_compute_swift_rate_1(self):
        self.assertEqual(mod_05.compute_swift_rate_1(409, 286), 236)

    def test_mod_05_compute_delta_weight_2(self):
        self.assertEqual(mod_05.compute_delta_weight_2(392, 455), 1)

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


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