Example #1
0
    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)
Example #2
0
    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)
Example #3
0
 def get_active_instance(cls):
     phrases = vocabcompiler.get_all_phrases()
     return cls.get_instance('default', phrases)
Example #4
0
 def get_active_instance(cls):
     phrases = vocabcompiler.get_all_phrases()
     return cls.get_instance('default', phrases)