Esempio n. 1
0
    def test_classify_rejects_reclassify(self, run):
        DB._reset()
        oc = control.OnlineControl()
        oc.init_swap()
        ret = oc.classify(self.mock_classification)

        assert ret is None
Esempio n. 2
0
    def test_classify(self, run):
        DB._reset()
        oc = control.OnlineControl()
        oc.init_swap()
        ret = oc.classify(self.mock_classification)

        assert isinstance(ret, swap.agents.subject.Subject)
        assert ret.score == 0.12
Esempio n. 3
0
    def test_length(self):
        DB._reset()
        db = DB()._db
        query = [{'$limit': 5}]

        c = Cursor(query, db.classifications)
        print(c.next())

        assert len(c) == 5