File: categories.py

package info (click to toggle)
simplebayes 3.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 496 kB
  • sloc: python: 3,322; makefile: 165; sh: 24
file content (23 lines) | stat: -rw-r--r-- 743 bytes parent folder | download
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)