Example #1
0
 def test_slugline(self):
     parser = CP_APMediaFeedParser()
     self.assertEqual('foo-bar-baz', parser.process_slugline('foo bar/baz'))
     self.assertEqual('foo-bar', parser.process_slugline('foo-bar'))
     self.assertEqual('foo-bar', parser.process_slugline('foo - bar'))
Example #2
0
import unittest
import superdesk
import requests_mock
import settings

from lxml import etree
from flask import json
from unittest.mock import MagicMock, patch

from tests.mock import SEQUENCE_NUMBER, resources
from tests.ingest.parser import get_fixture_path

from cp.ingest import CP_APMediaFeedParser
from cp.output.formatter.jimi import JimiFormatter

parser = CP_APMediaFeedParser()
formatter = JimiFormatter()


def fixture(filename):
    return os.path.join(
        os.path.dirname(__file__),
        "fixtures",
        filename,
    )


class AP2JimiTestCase(unittest.TestCase):

    app = flask.Flask(__name__)
    app.locators = MagicMock()
Example #3
0
 def test_slugline(self):
     parser = CP_APMediaFeedParser()
     self.assertEqual("foo-bar-baz", parser.process_slugline("foo bar/baz"))
     self.assertEqual("foo-bar", parser.process_slugline("foo-bar"))
     self.assertEqual("foo-bar", parser.process_slugline("foo - bar"))