# Path: model/piece.py
# def parse_content(content):
# def add(user_id,content,link=None,private=False,pics=None):
# def get_by_id(id):
# def get_random(limit=100):
# def get_all(limit=None):


import unittest
from model import piece
            "author":None,
            "work":None
        })

    def testTooManySpliter(self):
        # 过多链接符忽略
        self.assertEqual(piece.parse_content("https://stacksocial.com/sales/the-mac-freebie-bundle-2-0"),{
            "content":"https://stacksocial.com/sales/the-mac-freebie-bundle-2-0",
            "author":None,
            "work":None
        })

    def testByIssue(self):


        self.assertEqual(piece.parse_content(u"It's better to fail than to pass by pure luck."),{
            "content":u"It's better to fail than to pass by pure luck.",
            "author":None,
            "work":None
        })

    def testAuthorSentance(self):
        self.assertEqual(piece.parse_content(u"我会唱歌我知道\n对于评审给我这样的肯定\n我也给予肯定\n----王菲，金曲獎十五屆最佳女演唱人得獎感言"),{
            "content":u"我会唱歌我知道\n对于评审给我这样的肯定\n我也给予肯定\n----王菲，金曲獎十五屆最佳女演唱人得獎感言",
            "author":None,
            "work":None
        })

    def testParseContent(self):
        """ testParseContent """

# Path: model/piece.py
# def parse_content(content):
# def add(user_id,content,link=None,private=False,pics=None):
# def get_by_id(id):
# def get_random(limit=100):
# def get_all(limit=None):


# Path: test/piece_test.py
import unittest
from model import piece

            "author":None,
            "work":None
        })

    def testTooManySpliter(self):
        # 过多链接符忽略
        self.assertEqual(piece.parse_content("https://stacksocial.com/sales/the-mac-freebie-bundle-2-0"),{
            "content":"https://stacksocial.com/sales/the-mac-freebie-bundle-2-0",
            "author":None,
            "work":None
        })

    def testByIssue(self):


        self.assertEqual(piece.parse_content(u"It's better to fail than to pass by pure luck."),{
            "content":u"It's better to fail than to pass by pure luck.",
            "author":None,
            "work":None
        })

    def testAuthorSentance(self):
        self.assertEqual(piece.parse_content(u"我会唱歌我知道\n对于评审给我这样的肯定\n我也给予肯定\n----王菲，金曲獎十五屆最佳女演唱人得獎感言"),{
            "content":u"我会唱歌我知道\n对于评审给我这样的肯定\n我也给予肯定\n----王菲，金曲獎十五屆最佳女演唱人得獎感言",
            "author":None,
            "work":None
        })

    def testParseContent(self):
        """ testParseContent """

        self.assertEqual(piece.parse_content(u"愚蠢的人饱受其愚蠢所带来的疲累之苦。       by 叔本华"),{