Esempio n. 1
0
 def test_no_synonyms(self):
     """Test that when there are no synonyms an alternate filter is made."""
     _, body = es_utils.es_get_synonym_filter('en-US')
     eq_(body, {
         'type': 'synonym',
         'synonyms': ['firefox => firefox'],
     })
Esempio n. 2
0
 def test_no_synonyms(self):
     """Test that when there are no synonyms an alternate filter is made."""
     _, body = es_utils.es_get_synonym_filter("en-US")
     eq_(body, {
         "type": "synonym",
         "synonyms": ["firefox => firefox"],
     })
Esempio n. 3
0
 def test_no_synonyms(self):
     """Test that when there are no synonyms an alternate filter is made."""
     _, body = es_utils.es_get_synonym_filter('en-US')
     eq_(body, {
         'type': 'synonym',
         'synonyms': ['firefox => firefox'],
         })
Esempio n. 4
0
    def test_with_some_synonyms(self):
        SynonymFactory(from_words="foo", to_words="bar")
        SynonymFactory(from_words="baz", to_words="qux")

        _, body = es_utils.es_get_synonym_filter("en-US")

        expected = {
            "type": "synonym",
            "synonyms": ["foo => bar", "baz => qux",],
        }
        eq_(body, expected)
Esempio n. 5
0
    def test_with_some_synonyms(self):
        synonym(from_words='foo', to_words='bar', save=True)
        synonym(from_words='baz', to_words='qux', save=True)

        _, body = es_utils.es_get_synonym_filter('en-US')

        expected = {
            'type': 'synonym',
            'synonyms': [
                'foo => bar',
                'baz => qux',
            ],
        }

        eq_(body, expected)
Esempio n. 6
0
    def test_with_some_synonyms(self):
        SynonymFactory(from_words='foo', to_words='bar')
        SynonymFactory(from_words='baz', to_words='qux')

        _, body = es_utils.es_get_synonym_filter('en-US')

        expected = {
            'type': 'synonym',
            'synonyms': [
                'foo => bar',
                'baz => qux',
            ],
        }

        eq_(body, expected)
Esempio n. 7
0
 def test_name(self):
     """Test that the right name is returned."""
     name, _ = es_utils.es_get_synonym_filter("en-US")
     eq_(name, "synonyms-en-US")
Esempio n. 8
0
 def test_name(self):
     """Test that the right name is returned."""
     name, _ = es_utils.es_get_synonym_filter('en-US')
     eq_(name, 'synonyms-en-US')