def testPhraseExtraction(self): expected_phrases = ['MOCK'] mock_module = mock.Mock() mock_module.WORDS = ['MOCK'] with mock.patch('client.brain.Brain.get_modules', classmethod(lambda cls: [mock_module])): extracted_phrases = vocabcompiler.get_all_phrases() self.assertEqual(expected_phrases, extracted_phrases)
def get_active_instance(cls): phrases = vocabcompiler.get_all_phrases() return cls.get_instance('default', phrases)