1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
# pylint: disable=invalid-name,missing-docstring
from simplebayes.categories import BayesCategories
from simplebayes.category import BayesCategory
import unittest
class BayesCategoriesTests(unittest.TestCase):
def test_add_category(self):
bc = BayesCategories()
bc.add_category('foo')
self.assertIn('foo', bc.categories)
self.assertIsInstance(bc.categories['foo'], BayesCategory)
def test_get_category(self):
bc = BayesCategories()
bc.add_category('foo')
self.assertIsInstance(bc.get_category('foo'), BayesCategory)
def test_get_categories(self):
bc = BayesCategories()
bc.add_category('foo')
self.assertEqual(bc.get_categories(), bc.categories)
|