From ae8b72dfeec74ecb021156a945e1906c90e00d4b Mon Sep 17 00:00:00 2001 From: Vitaly Bogomolov Date: Sat, 2 Dec 2023 15:29:59 +0400 Subject: [PATCH] fix codacy issues (#4) --- pipeline_integrity/method/asme/b31g_2012.py | 9 +++------ tests/test/test_i18n.py | 6 +++--- tests/test/test_method/test_asme/test_b31g_1991.py | 6 +++--- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/pipeline_integrity/method/asme/b31g_2012.py b/pipeline_integrity/method/asme/b31g_2012.py index 935d9e3..93a0b7f 100644 --- a/pipeline_integrity/method/asme/b31g_2012.py +++ b/pipeline_integrity/method/asme/b31g_2012.py @@ -114,12 +114,9 @@ def get_stress_fail(self): ), '\n', "stress_fail = {} * (1 - 2/3 * ({} / {})) / (1 - 2/3 * ({} / {} / {})) = {}.".format( round(s_f, EXPL_ROUND), - round(self.anomaly.depth, EXPL_ROUND), - round(self.anomaly.pipe.wallthickness, EXPL_ROUND), - round(self.anomaly.depth, EXPL_ROUND), - round(self.anomaly.pipe.wallthickness, EXPL_ROUND), - round(m_val, EXPL_ROUND), - round(s_p, EXPL_ROUND), + round(self.anomaly.depth, EXPL_ROUND), round(self.anomaly.pipe.wallthickness, EXPL_ROUND), + round(self.anomaly.depth, EXPL_ROUND), round(self.anomaly.pipe.wallthickness, EXPL_ROUND), + round(m_val, EXPL_ROUND), round(s_p, EXPL_ROUND), ), ]) diff --git a/tests/test/test_i18n.py b/tests/test/test_i18n.py index 3ea3726..a544972 100644 --- a/tests/test/test_i18n.py +++ b/tests/test/test_i18n.py @@ -9,8 +9,8 @@ class TestsI18n(TestBase): """Module i18n.py.""" - def test_fake_gettext(self): - """Function fake_gettext.""" + def test_fgettext(self): + """Check fake_gettext function.""" from pipeline_integrity.i18n import fake_gettext, Lang from pipeline_integrity.method.asme.b31g_1991 import Context @@ -26,7 +26,7 @@ def test_fake_gettext(self): @staticmethod def test_load_po(): - """Function load_po.""" + """Check load_po function.""" from pipeline_integrity.i18n import load_po data = load_po(os.path.join( diff --git a/tests/test/test_method/test_asme/test_b31g_1991.py b/tests/test/test_method/test_asme/test_b31g_1991.py index 10e056d..dc73607 100644 --- a/tests/test/test_method/test_asme/test_b31g_1991.py +++ b/tests/test/test_method/test_asme/test_b31g_1991.py @@ -159,13 +159,13 @@ def test_example3(self): self.pipe.diameter = 24 self.pipe.wallthickness = 0.432 self.defect.depth = 0.13 - self.defect.length = 30.0 self.pipe.maop = 910 + self.defect.length = 30.0 - assert round(self.asme.get_a(self.defect.length), 3) == 7.668 # 8.320 - assert round(self.asme.get_design_pressure()) == 1348 assert round(self.asme.get_safe_pressure()) == 1036 # 1037 assert round(self.asme.defect_max_length(), 3) == 4.789 # INFINITY ? + assert round(self.asme.get_a(self.defect.length), 3) == 7.668 # 8.320 + assert round(self.asme.get_design_pressure()) == 1348 self.defect.depth = 0.167 assert round(self.asme.defect_max_length(), 3) == 3.557 # 30.0