Exemplo n.º 1
0
    def test_pandoc(self):
        markdown_text = u"""\
Hello
=====
We're loving Markdown"""

        expected_result = u"""\
h1. Hello

We're loving Markdown

"""

        self.assertEqual(convert(markdown_text, 'markdown', 'textile'), expected_result)
Exemplo n.º 2
0
    def test_pandoc(self):
        markdown_text = u"""\
Hello
=====
We're loving Markdown"""

        expected_result = u"""\
h1(#hello). Hello

We're loving Markdown

"""

        self.assertEqual(convert(markdown_text, "markdown", "textile"), expected_result)
Exemplo n.º 3
0
 def convert_to_local_issue(self, foreign_issue):
     assert isinstance(foreign_issue, Issue)
     service_from = 'redmine'
     if hasattr(foreign_issue, 'assigned_to'):
         idMembers = [self.storage.get_user_or_member_id(service_from, foreign_issue.assigned_to['id'])]
     else:
         idMembers = [None]
     card = Card(
         id = self.storage.get_opposite_item_id(service_from, foreign_issue.id),
         idMembers = idMembers,
         name = foreign_issue.subject,
         desc = pandoc.convert(foreign_issue.get('description'), 'textile', 'markdown'),
         idList = self.storage.get_list_or_status_id(service_from, foreign_issue.status['id']),
         idBoard = self.config.board_id,
         due = foreign_issue.get('due_date', 'null'),
         client = self.client,
     )
     return card
Exemplo n.º 4
0
    def convert_to_local_issue(self, foreign_issue):
        assert isinstance(foreign_issue, Card)
        service_from = 'trello'

        if len(foreign_issue.idMembers):
            assigned_to_id = self.storage.get_user_or_member_id(service_from, foreign_issue.idMembers[0])
        else:
            assigned_to_id = None

        issue = Issue(
            id = self.storage.get_opposite_item_id(service_from, foreign_issue.id),
            assigned_to_id = assigned_to_id,
            subject = foreign_issue.name,
            description = pandoc.convert(foreign_issue.desc, 'markdown', 'textile'),
            status_id = self.storage.get_list_or_status_id(service_from, foreign_issue.idList),
            project_id = self.config.project_id,
            tracker_id = self.config.get('tracker_id'),
            due_date = foreign_issue.get('due'),
            client = self.client
        )
        return issue
Exemplo n.º 5
0
 def test_not_installed(self):
     unicode_text = u'Hello _worlds_'
     self.assertEqual(convert(unicode_text, 'textile', 'markdown').strip(), unicode_text)
Exemplo n.º 6
0
 def test_unicode(self):
     unicode_text = u'Привет'
     self.assertEqual(convert(unicode_text, 'textile', 'markdown').strip(), unicode_text)
Exemplo n.º 7
0
 def test_not_installed(self):
     unicode_text = u"Hello _worlds_"
     self.assertEqual(convert(unicode_text, "textile", "markdown").strip(), unicode_text)
Exemplo n.º 8
0
 def test_unicode(self):
     unicode_text = u"Привет"
     self.assertEqual(convert(unicode_text, "textile", "markdown").strip(), unicode_text)