def setUp(self):
     """ setup any state tied to the execution of the given method in a
     class.  setup_method is invoked for every test method of a class.
     """
     self.test_subject = KnowledgeTracingPlugin(
         123, 456, None,
         shlex.quote(
             json.dumps({
                 "shared_messages": {
                     "get_student_model_fragment":
                     ["88bb246d-7347-4f57-8cbe-95944a4e0027"]
                 },
                 "transaction_management": "999",
             })))
     self.test_subject.send_response = MagicMock()
 def test_constructor(self):
     """
     KnowledgeTracingPlugin.__init__() Test plan:
         - make sure logger set right
         - make sure self.mongo is a mongo client
         - make sure db is a collection
         -check full name
     """
     ds = KnowledgeTracingPlugin(
         1234, 5678, None,
         shlex.quote(
             json.dumps({
                 "shared_messages": {
                     "get_student_model_fragment":
                     ["88bb246d-7347-4f57-8cbe-95944a4e0027"]
                 },
                 "transaction_management": "999"
             })))
     ds.logger.should.equal(None)
     isinstance(ds.mongo, MongoClient).should.equal(True)
     isinstance(ds.db, Collection).should.equal(True)
     ds.db.full_name.should.equal(
         "hpit_unit_test_db.hpit_knowledge_tracing")