Esempio n. 1
0
def test_make_key():
    class DummyTest:
        def __init__(self, value):

            self.value = value

        def dummy_method(self, value):  # Add this method to by pass linting
            self.value = value

    test = DummyTest(8)
    test.dummy_method(10)
    with pytest.raises(ValueError, match=r"Unexpected type"):
        make_key(test)
Esempio n. 2
0
 def f_grass_wet(sprinkler, rain, grass_wet):
     table = dict()
     table["fft"] = 0.0
     table["fff"] = 1.0
     table["ftt"] = 0.8
     table["ftf"] = 0.2
     table["tft"] = 0.9
     table["tff"] = 0.1
     table["ttt"] = 0.99
     table["ttf"] = 0.01
     return table[make_key(sprinkler, rain, grass_wet)]
Esempio n. 3
0
 def f_h(e, g, h):
     tt = dict(
         ttt=0.05,
         ttf=0.95,
         tft=0.95,
         tff=0.05,
         ftt=0.95,
         ftf=0.05,
         fft=0.95,
         fff=0.05,
     )
     return tt[make_key(e, g, h)]
Esempio n. 4
0
 def f_f(d, e, f):
     tt = dict(
         ttt=0.01,
         ttf=0.99,
         tft=0.01,
         tff=0.99,
         ftt=0.01,
         ftf=0.99,
         fft=0.99,
         fff=0.01,
     )
     return tt[make_key(d, e, f)]
Esempio n. 5
0
 def f_g(c, g):
     tt = dict(tt=0.8, tf=0.2, ft=0.1, ff=0.9)
     return tt[make_key(c, g)]
Esempio n. 6
0
 def f_e(c, e):
     tt = dict(tt=0.3, ft=0.6, tf=0.7, ff=0.4)
     return tt[make_key(c, e)]
Esempio n. 7
0
 def f_d(b, d):
     tt = dict(tt=0.9, ft=0.5, tf=0.1, ff=0.5)
     return tt[make_key(b, d)]
Esempio n. 8
0
 def f_c(a, c):
     tt = dict(tt=0.7, ft=0.2, tf=0.3, ff=0.8)
     return tt[make_key(a, c)]
Esempio n. 9
0
 def f_b(a, b):
     tt = dict(tt=0.5, ft=0.4, tf=0.5, ff=0.6)
     return tt[make_key(a, b)]