コード例 #1
0
    def test_analyze_processed_response(self):
        for word in self.VALID_WORDS:
            analyzer = PrepositionMorphologicalAnalyzer(word)
            analyzer.analyze()

            assert analyzer.analyze() is None
            assert analyzer.analyze() is None
コード例 #2
0
    def test_analyze_word(self):
        for word in self.VALID_WORDS:
            analyzer = PrepositionMorphologicalAnalyzer(word)
            analyzer.analyze()

            assert isinstance(analyzer.word, Preposition)
            assert analyzer.word.content == word
コード例 #3
0
    def test_analyze_processed(self):
        for word in self.VALID_WORDS:
            analyzer = PrepositionMorphologicalAnalyzer(word)

            assert analyzer.processed is False

            analyzer.analyze()

            assert analyzer.processed is True
コード例 #4
0
    def test_analyze_return_true(self):
        for word in self.VALID_WORDS:
            analyzer = PrepositionMorphologicalAnalyzer(word)

            assert analyzer.analyze()
コード例 #5
0
    def test_analyze_match(self):
        for word in self.VALID_WORDS:
            analyzer = PrepositionMorphologicalAnalyzer(word)
            analyzer.analyze()

            assert analyzer.matches is not None
コード例 #6
0
    def test_prepositions_list(self):
        for word in PrepositionMorphologicalAnalyzer.PREPOSITIONS_LIST:
            analyzer = PrepositionMorphologicalAnalyzer(word)

            assert analyzer.analyze()
コード例 #7
0
    def test_invalid_analyze_word(self):
        for word in self.INVALID_WORDS:
            analyzer = PrepositionMorphologicalAnalyzer(word)
            analyzer.analyze()

            assert analyzer.word is None
コード例 #8
0
    def test_invalid_analyze(self):
        for word in self.INVALID_WORDS:
            analyzer = PrepositionMorphologicalAnalyzer(word)
            result = analyzer.analyze()

            assert not result