Adds travis testing skeleton

This commit is contained in:
LSaldyt
2017-10-09 13:01:18 -06:00
parent be06e22f64
commit f3e1c875de
2 changed files with 8 additions and 0 deletions

5
.travis.yml Normal file
View File

@ -0,0 +1,5 @@
language: python
python:
- "3.6"
script:
- python3 tests.py

View File

@ -1,4 +1,6 @@
import unittest
from pprint import pprint
from copycat import Copycat
# TODO: update test cases to use entropy
@ -67,6 +69,7 @@ class TestCopycat(unittest.TestCase):
self.fail('No instances of expected key %s were produced! %r != %r' % (k, actual, expected))
def run_testcase(self, initial, modified, target, iterations, expected):
pprint(expected)
actual = Copycat().run(initial, modified, target, iterations)
self.assertEqual(sum(a['count'] for a in list(actual.values())), iterations)
self.assertProbabilitiesLookRoughlyLike(actual, expected)