Updates tests
This commit is contained in:
@ -1,6 +1,7 @@
|
|||||||
import math
|
import math
|
||||||
|
|
||||||
# Alternate formulas for getAdjustedProbability
|
# Alternate formulas for getAdjustedProbability
|
||||||
|
|
||||||
def _original(temp, prob):
|
def _original(temp, prob):
|
||||||
if prob == 0 or prob == 0.5 or temp == 0:
|
if prob == 0 or prob == 0.5 or temp == 0:
|
||||||
return prob
|
return prob
|
||||||
|
|||||||
2
tests.py
2
tests.py
@ -69,7 +69,7 @@ class TestCopycat(unittest.TestCase):
|
|||||||
self.fail('No instances of expected key %s were produced! %r != %r' % (k, actual, expected))
|
self.fail('No instances of expected key %s were produced! %r != %r' % (k, actual, expected))
|
||||||
|
|
||||||
def run_testcase(self, initial, modified, target, iterations, expected):
|
def run_testcase(self, initial, modified, target, iterations, expected):
|
||||||
pprint(expected)
|
#tpprint(expected)
|
||||||
actual = Copycat().run(initial, modified, target, iterations)
|
actual = Copycat().run(initial, modified, target, iterations)
|
||||||
self.assertEqual(sum(a['count'] for a in list(actual.values())), iterations)
|
self.assertEqual(sum(a['count'] for a in list(actual.values())), iterations)
|
||||||
self.assertProbabilitiesLookRoughlyLike(actual, expected)
|
self.assertProbabilitiesLookRoughlyLike(actual, expected)
|
||||||
|
|||||||
Reference in New Issue
Block a user