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

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


class TestQuotas(unittest.TestCase):
    def test_mod_00_compute_lean_load_0(self):
        self.assertEqual(mod_00.compute_lean_load_0(498, 438), 117)

    def test_mod_00_compute_prime_span_1(self):
        self.assertEqual(mod_00.compute_prime_span_1(169, 307), 277)

    def test_mod_00_compute_solid_load_2(self):
        self.assertEqual(mod_00.compute_solid_load_2(344, 296), 160)

    def test_mod_01_compute_prime_score_0(self):
        self.assertEqual(mod_01.compute_prime_score_0(482, 225), 359)

    def test_mod_01_compute_delta_rate_1(self):
        self.assertEqual(mod_01.compute_delta_rate_1(175, 303), 69)

    def test_mod_01_compute_rapid_span_2(self):
        self.assertEqual(mod_01.compute_rapid_span_2(179, 48), 329)

    def test_mod_02_compute_batch_index_0(self):
        self.assertEqual(mod_02.compute_batch_index_0(188, 218), 39)

    def test_mod_02_compute_solid_margin_1(self):
        self.assertEqual(mod_02.compute_solid_margin_1(262, 477), 246)

    def test_mod_02_compute_stable_score_2(self):
        self.assertEqual(mod_02.compute_stable_score_2(61, 68), 136)

    def test_mod_03_compute_lean_load_0(self):
        self.assertEqual(mod_03.compute_lean_load_0(100, 239), 24)

    def test_mod_03_compute_delta_load_1(self):
        self.assertEqual(mod_03.compute_delta_load_1(431, 226), 240)

    def test_mod_03_compute_swift_factor_2(self):
        self.assertEqual(mod_03.compute_swift_factor_2(177, 358), 68)

    def test_mod_04_compute_lean_load_0(self):
        self.assertEqual(mod_04.compute_lean_load_0(40, 419), 175)

    def test_mod_04_compute_lean_margin_1(self):
        self.assertEqual(mod_04.compute_lean_margin_1(48, 134), 239)

    def test_mod_04_compute_rapid_margin_2(self):
        self.assertEqual(mod_04.compute_rapid_margin_2(147, 27), 27)

    def test_mod_05_compute_swift_span_0(self):
        self.assertEqual(mod_05.compute_swift_span_0(302, 18), 314)

    def test_mod_05_compute_lean_load_1(self):
        self.assertEqual(mod_05.compute_lean_load_1(144, 154), 110)

    def test_mod_05_compute_delta_weight_2(self):
        self.assertEqual(mod_05.compute_delta_weight_2(288, 118), 349)

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


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