Skip to content

Commit

Permalink
Merge pull request #13 from febrifahmi/dev
Browse files Browse the repository at this point in the history
update: add some tests for r2 to r3
  • Loading branch information
febrifahmi authored Feb 16, 2023
2 parents b520cbb + 81f67a3 commit a28079f
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 7 deletions.
Binary file modified .coverage
Binary file not shown.
10 changes: 5 additions & 5 deletions geotekppu/rmr/rmr__bieniawski1989.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ def r2(drillcoreRQD):
val_r2 = 0
if 100 >= drillcoreRQD and drillcoreRQD >= 90:
val_r2 = 20
elif 90 >= drillcoreRQD and drillcoreRQD >= 75:
elif 90 > drillcoreRQD and drillcoreRQD >= 75:
val_r2 = 17
elif 75 >= drillcoreRQD and drillcoreRQD >= 50:
elif 75 > drillcoreRQD and drillcoreRQD >= 50:
val_r2 = 13
elif 50 >= drillcoreRQD and drillcoreRQD >= 25:
elif 50 > drillcoreRQD and drillcoreRQD >= 25:
val_r2 = 8
elif drillcoreRQD < 25:
val_r2 = 3
Expand All @@ -103,9 +103,9 @@ def r3(spacing):
val_r3 = 20
elif 2.0 >= spacing and spacing >= 0.6:
val_r3 = 15
elif 0.6 >= spacing and spacing >= 0.2:
elif 0.6 > spacing and spacing >= 0.2:
val_r3 = 10
elif 0.2 >= spacing and spacing >= 0.06:
elif 0.2 > spacing and spacing >= 0.06:
val_r3 = 8
elif spacing < 0.06:
val_r3 = 5
Expand Down
122 changes: 120 additions & 2 deletions test/test_rmr89.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from geotekppu.rmr.rmr__bieniawski1989 import r1, r2, r3, r4, r5, rmr89

class TestRMR89(unittest.TestCase):

# Test function r1
def test_r1_1(self):
self.assertEqual(r1("pls", 16), 15)

Expand Down Expand Up @@ -53,7 +53,8 @@ def test_r1_16(self):

def test_r1_17(self):
self.assertEqual(r1("ucs", 0.73), 0)


# assertNotEqual
def test_r1_18(self):
self.assertNotEqual(r1("ucs", 251), 7)

Expand All @@ -75,6 +76,123 @@ def test_r1_23(self):
def test_r1_24(self):
self.assertNotEqual(r1("ucs", 0.73), 14)

# Test function r2
def test_r2_1(self):
self.assertEqual(r2(100),20)

def test_r2_2(self):
self.assertEqual(r2(90),20)

def test_r2_3(self):
self.assertEqual(r2(89),17)

def test_r2_4(self):
self.assertEqual(r2(75),17)

def test_r2_5(self):
self.assertEqual(r2(74),13)

def test_r2_6(self):
self.assertEqual(r2(50),13)

def test_r2_7(self):
self.assertEqual(r2(49),8)

def test_r2_8(self):
self.assertEqual(r2(25),8)

def test_r2_9(self):
self.assertEqual(r2(25),8)

def test_r2_10(self):
self.assertEqual(r2(24),3)

# assertNotEqual
def test_r2_11(self):
self.assertNotEqual(r2(100),3)

def test_r2_12(self):
self.assertNotEqual(r2(90),8)

def test_r2_13(self):
self.assertNotEqual(r2(89),20)

def test_r2_14(self):
self.assertNotEqual(r2(75),20)

def test_r2_15(self):
self.assertNotEqual(r2(74),8)

def test_r2_16(self):
self.assertNotEqual(r2(50),8)

def test_r2_17(self):
self.assertNotEqual(r2(49),3)

def test_r2_18(self):
self.assertNotEqual(r2(25),17)

def test_r2_19(self):
self.assertNotEqual(r2(25),20)

def test_r2_20(self):
self.assertNotEqual(r2(24),17)

# Test function r3
def test_r3_1(self):
self.assertEqual(r3(2.1),20)

def test_r3_2(self):
self.assertEqual(r3(2.0),15)

def test_r3_3(self):
self.assertEqual(r3(1.7),15)

def test_r3_4(self):
self.assertEqual(r3(0.6),15)

def test_r3_5(self):
self.assertEqual(r3(0.55),10)

def test_r3_6(self):
self.assertEqual(r3(0.2),10)

def test_r3_7(self):
self.assertEqual(r3(0.19),8)

def test_r3_8(self):
self.assertEqual(r3(0.06),8)

def test_r3_9(self):
self.assertEqual(r3(0.055),5)

# assertNotEqual
def test_r3_10(self):
self.assertNotEqual(r3(2.1),15)

def test_r3_11(self):
self.assertNotEqual(r3(2.0),20)

def test_r3_12(self):
self.assertNotEqual(r3(1.7),20)

def test_r3_13(self):
self.assertNotEqual(r3(0.6),10)

def test_r3_14(self):
self.assertNotEqual(r3(0.55),15)

def test_r3_15(self):
self.assertNotEqual(r3(0.2),15)

def test_r3_16(self):
self.assertNotEqual(r3(0.19),20)

def test_r3_17(self):
self.assertNotEqual(r3(0.06),15)

def test_r3_18(self):
self.assertNotEqual(r3(0.055),10)


if __name__ == '__main__':
Expand Down

0 comments on commit a28079f

Please sign in to comment.