Example #1
0
    def test_add_cover_other_link(self):
        testCover = TestDict(**{
            'url': 'testURL',
            'media_type': 'image/test',
            'flags': {'cover': False}
        })

        coverRec = ESDoc.addCover(testCover)
        assert coverRec is None
Example #2
0
    def test_add_cover_json_object(self):
        testCover = TestDict(**{
            'url': 'testURL',
            'media_type': 'image/test',
            'flags': {'cover': True}
        })

        coverRec = ESDoc.addCover(testCover)
        assert coverRec.url == 'testURL'
        assert coverRec.media_type == 'image/test'
Example #3
0
    def test_add_cover_json_string(self):
        testCover = TestDict(**{
            'url': 'testURL',
            'media_type': 'image/test',
            'flags': '{"cover": true}'
        })

        coverRec = ESDoc.addCover(testCover)
        assert coverRec.url == 'testURL'
        assert coverRec.media_type == 'image/test'
    def test_add_cover_json_string(self):
        testCover = TestDict(
            **{
                'url': 'testURL',
                'media_type': 'image/test',
                'flags': '{"cover": true}'
            })

        coverRec = ESDoc.addCover(testCover)
        self.assertEqual(coverRec.url, 'testURL')
        self.assertEqual(coverRec.media_type, 'image/test')
    def test_add_cover_json_object(self):
        testCover = TestDict(**{
            'url': 'testURL',
            'media_type': 'image/test',
            'flags': {
                'cover': True
            }
        })

        coverRec = ESDoc.addCover(testCover)
        self.assertEqual(coverRec.url, 'testURL')
        self.assertEqual(coverRec.media_type, 'image/test')