Пример #1
0
def test_716():
    rs = RedmineScraper("")
    data = open(os.path.join(get_testdata(), "716.html")).read()
    issue = rs.parse_issue(data)

    # extracted
    eq_(issue["id"], "716")
    eq_(issue["title"], u"Apache FCGI documentation In Manual")
    eq_(issue["author"], u"Sam Kleinman")
    eq_(issue["creation-date"], "12/20/2011 10:23 am")
    eq_(issue["last-updated-date"], "12/22/2011 06:29 pm")

    eq_(issue["description"], u"")

    # details table
    eq_(issue["priority"], "Normal")
    eq_(issue["status"], "New")
    eq_(issue["start-date"], "12/20/2011")
    eq_(issue["due-date"], "")
    eq_(issue["assigned-to"], "Sam Kleinman")
    eq_(issue["progress"], "0%")
    eq_(issue["category"], "Documentation")
    eq_(issue["fixed-version"], "-")

    # history
    eq_(len(issue["history"]), 1)
    hist1 = issue["history"][0]
    eq_(hist1["date"], "12/22/2011 06:29 pm")
    eq_(hist1["author"], "Blaise Alleyne")
    props = hist1["properties"]
    eq_(len(props), 0)
Пример #2
0
def test_711():
    rs = RedmineScraper("")
    data = open(os.path.join(get_testdata(), "711.html")).read()
    issue = rs.parse_issue(data)

    # extracted
    eq_(issue["id"], "711")
    eq_(issue["title"], u'New feed library that uses lxml')
    eq_(issue["author"], u"Christopher Webber")
    eq_(issue["creation-date"], "12/14/2011 07:04 pm")
    eq_(issue["last-updated-date"], "12/14/2011 07:30 pm")

    eq_(issue["description"], u"We're finding that our present feeds aren't extensible enough and... well, we need to extend them! Inconexo is already working on this in a branch:\n\n[https://gitorious.org/~inconexo/mediagoblin/inconexos-mediagoblin/commits/feed_library][1]\n\nI'll leave comments on that as I read through here.\n\n   [1]: https://gitorious.org/~inconexo/mediagoblin/inconexos-mediagoblin/commits/feed_library\n\n")

    # details table
    eq_(issue["priority"], "Normal")
    eq_(issue["status"], "New")
    eq_(issue["start-date"], "12/14/2011")
    eq_(issue["due-date"], "")
    eq_(issue["assigned-to"], u"Inconexo \xf8")
    eq_(issue["progress"], "0%")
    eq_(issue["category"], "Programming")
    eq_(issue["fixed-version"], "0.2.1")

    # history
    eq_(len(issue["history"]), 2)
    hist1 = issue["history"][0]
    eq_(hist1["date"], "12/14/2011 07:15 pm")
    eq_(hist1["author"], "Christopher Webber")
    props = hist1["properties"]
    eq_(len(props), 0)
Пример #3
0
def test_694():
    rs = RedmineScraper("")
    data = open(os.path.join(get_testdata(), "694.html")).read()
    issue = rs.parse_issue(data)

    # extracted
    eq_(issue["id"], "694")
    eq_(issue["title"], u"On submit page, show the site's filesize limit")
    eq_(issue["author"], u"Greg Grossmeier")
    eq_(issue["creation-date"], "12/04/2011 02:02 pm")
    eq_(issue["last-updated-date"], "12/04/2011 02:02 pm")

    eq_(issue["description"], u'It is convenient for the user to know how big of a file they can upload before they try.\n')

    # details table
    eq_(issue["priority"], "Normal")
    eq_(issue["status"], "New")
    eq_(issue["start-date"], "12/04/2011")
    eq_(issue["due-date"], "")
    eq_(issue["assigned-to"], "-")
    eq_(issue["progress"], "0%")
    eq_(issue["category"], "Graphic Design / UI")
    eq_(issue["fixed-version"], "-")

    # history
    eq_(len(issue["history"]), 0)
Пример #4
0
def test_725():
    rs = RedmineScraper("")
    data = open(os.path.join(get_testdata(), "725.html")).read()
    issue = rs.parse_issue(data)

    # extracted
    eq_(issue["id"], "725")
    eq_(issue["title"], u"atom feed shows a wrong URL when using apache with mod_proxy")
    eq_(issue["author"], u"Michele Azzolari")
    eq_(issue["creation-date"], "12/28/2011 06:44 pm")
    eq_(issue["last-updated-date"], "12/29/2011 09:45 am")

    eq_(issue["description"], u'Setup: I have a virtual host for media.macno.org and I use mod_proxy to access my mediagoblin server (which listen on 127.0.0.1:6543)\n\nIssue: atom feed self link uses a wrong url\n\nFor example requesting [http://media.macno.org/u/macno/atom/][1] returns <link href="http://127.0.0.1:6543/u/macno/atom/" rel="self" />\n\n   [1]: http://media.macno.org/u/macno/atom/\n\n')

    # details table
    eq_(issue["priority"], "Normal")
    eq_(issue["status"], "New")
    eq_(issue["start-date"], "12/28/2011")
    eq_(issue["due-date"], "")
    eq_(issue["assigned-to"], "-")
    eq_(issue["progress"], "0%")
    eq_(issue["category"], "-")
    eq_(issue["fixed-version"], "-")

    # history
    eq_(len(issue["history"]), 1)
    hist1 = issue["history"][0]
    eq_(hist1["date"], "12/29/2011 09:45 am")
    eq_(hist1["author"], "Michele Azzolari")
    props = hist1["properties"]
    eq_(len(props), 0)
Пример #5
0
def test_491():
    rs = RedmineScraper("")
    data = open(os.path.join(get_testdata(), "491.html")).read()
    issue = rs.parse_issue(data)

    # extracted
    eq_(issue["id"], "491")
    eq_(issue["title"], "Contributors to the code may be surprised to learn of PEP-8")
    eq_(issue["author"], "Caleb Davis")
    eq_(issue["creation-date"], "08/10/2011 02:32 pm")
    eq_(issue["last-updated-date"], "09/04/2011 09:44 am")

    eq_(issue["description"], "I know I was...There are places in redmine mentioning PEP-8 style guidelines ([http://www.python.org/dev/peps/pep-0008/][1]), but there is no prominent mention in the contributor docs. This suggestion just came up again in IRC. This issue needs:\n\n  * decide where to mention and link to PEP-8\n  * add it to the contributor documentation\n\n   [1]: http://www.python.org/dev/peps/pep-0008/\n\n")

    # details table
    eq_(issue["priority"], "Normal")
    eq_(issue["status"], "New")
    eq_(issue["start-date"], "08/10/2011")
    eq_(issue["due-date"], "")
    eq_(issue["assigned-to"], "Will Kahn-Greene")
    eq_(issue["progress"], "0%")
    eq_(issue["category"], "Documentation")
    eq_(issue["fixed-version"], "0.1.0")

    # relations
    eq_(len(issue["relations"]), 0)

    # watchers
    eq_(len(issue["watchers"]), 2)
    eq_(issue["watchers"], ["Jim Campbell", "Will Kahn-Greene"])

    # history
    eq_(len(issue["history"]), 3)
    hist1 = issue["history"][0]
    eq_(hist1["date"], "08/11/2011 10:29 pm")
    eq_(hist1["author"], "Christopher Webber")
    props = hist1["properties"]
    eq_(len(props), 0)
    eq_(hist1["comment"], "[+ Jim Campbell, Will Kahn-Greene]\n\nI think we need a style guide page on the wiki altogether.\n\nMaybe that belongs on [http://wiki.mediagoblin.org/Code_style_guide][1] ?\n\n   [1]: http://wiki.mediagoblin.org/Code_style_guide\n\n")

    hist2 = issue["history"][1]
    eq_(hist2["date"], "09/04/2011 09:44 am")
    eq_(hist2["author"], "Will Kahn-Greene")
    props = hist2["properties"]
    eq_(len(props), 1)
    eq_(hist2["comment"], "Chris and I bandied about what should be in a code style guide for a bit now. I'll grab this bug and throw one together soon.\n")

    hist3 = issue["history"][2]
    eq_(hist3["date"], "09/04/2011 09:44 am")
    eq_(hist3["author"], "Will Kahn-Greene")
    props = hist3["properties"]
    eq_(len(props), 1)
    eq_(props[0], {
            "property": "Target version",
            "newvalue": "0.1.0",
            "oldvalue": "0.0.5"
            })

    eq_(hist3["comment"], "Bumping this to 0.1.0 since 0.0.5 is out now.\n")
Пример #6
0
def test_519():
    rs = RedmineScraper("")
    data = open(os.path.join(get_testdata(), "519.html")).read()
    issue = rs.parse_issue(data)

    # extracted
    eq_(issue["id"], "519")
    eq_(issue["title"], u"CloudFilesStorage.get_file() performance issue.")
    eq_(issue["author"], u"Joar Wandborg")
    eq_(issue["creation-date"], "08/24/2011 06:08 pm")
    eq_(issue["last-updated-date"], "08/27/2011 10:07 pm")

    eq_(issue["description"], u'For the thumb listings such as the index page, gallery page a call to cloudfiles is made for every thumbnail on the page.\n\nCloudFilesStorage should be changed to save container_url on _init_, and then use self._resolve_filepath() to generate the filepath without verifying that the file exists, just like BasicFileStorage does.\n')

    # details table
    eq_(issue["priority"], "Normal")
    eq_(issue["status"], "Closed")
    eq_(issue["start-date"], "08/24/2011")
    eq_(issue["due-date"], "")
    eq_(issue["assigned-to"], "Christopher Webber")
    eq_(issue["progress"], "50%")
    eq_(issue["category"], "Programming")
    eq_(issue["fixed-version"], "0.0.5")

    # history
    eq_(len(issue["history"]), 2)
    hist1 = issue["history"][0]
    eq_(hist1["date"], "08/24/2011 07:14 pm")
    eq_(hist1["author"], "Joar Wandborg")
    props = hist1["properties"]
    eq_(props[0], {
            "property": "Status",
            "oldvalue": "New",
            "newvalue": "Feedback"
            })
    eq_(props[1], {
            "property": "Assigned to",
            "oldvalue": "Joar Wandborg",
            "newvalue": "Christopher Webber"
            })
    eq_(props[2], {
            "property": "% Done",
            "oldvalue": "0",
            "newvalue": "50"
            })
    eq_(hist1["comment"], u'Hi Christopher, merge request filed at [https://gitorious.org/mediagoblin/mediagoblin/merge_requests/19][1]\n\nFeedback if any much appreciated.\n\nCheers,\n\n   [1]: https://gitorious.org/mediagoblin/mediagoblin/merge_requests/19\n\n')

    hist2 = issue["history"][1]
    eq_(hist2["date"], "08/27/2011 10:07 pm")
    eq_(hist2["author"], "Christopher Webber")
    props = hist2["properties"]
    eq_(props[0], {
            "property": "Status",
            "oldvalue": "Feedback",
            "newvalue": "Closed"
            })
    eq_(hist2["comment"], "Merged!\n")
Пример #7
0
def test_476():
    rs = RedmineScraper("")
    data = open(os.path.join(get_testdata(), "476.html")).read()
    issue = rs.parse_issue(data)

    # extracted
    eq_(issue["id"], "476")
    eq_(issue["title"], "tag clouds")
    eq_(issue["author"], "Caleb Davis")
    eq_(issue["creation-date"], "08/03/2011 12:33 pm")
    eq_(issue["last-updated-date"], "08/03/2011 12:37 pm")

    eq_(
        issue["description"],
        u"This is another rollover from [#360][1], but it got left behind somehow. A tag cloud is a dict-like object containing {'tag-name':frequency-of-use,...}. It's fun to have them to see all the tags that people are using publicly on an instance.\n\nWhere would we display these? \n\n  * instance home page - all users, processed media\n  * user's profile - user's processed media\n  * [BONUS] - arbitrary collection (/tags/bunnies)\n\nOpen questions: \n\n  * Should we use MapReduce? [http://cookbook.mongodb.org/patterns/count_tags/][2] The alternative would be to write tags to a text file and do \n    \n    sort tags_text_file | uniq -c\n\nor do it completely within python\n  * Should we use celery? Generating tag clouds shouldn't slow page renders. Thoughts:\n\n> do it with python if you're using MapReduce since, if MapReduce gets too slow, you just add more processors!\n\n> if it 'takes too long', then use celery\n\n  * How often do we update the clouds? Thoughts included:\n\n> not during a bulk upload\n\n  * How do we store these tag cloud objects? If we're not rendering them on the fly, then they should be in some kind of cache. Thoughts:\n\n> user['tag_cloud'] = dict\n\n> associate the cloud with the route. something like - {'/':'instance_cloud.txt','/u/user1':'user1_cloud.txt','/tags/bunnies':'tags_bunnies.txt'}\n\n   [1]: /issues/360 (tagging (Closed))\n   [2]: http://cookbook.mongodb.org/patterns/count_tags/\n\n",
    )

    # details table
    eq_(issue["priority"], "Normal")
    eq_(issue["status"], "New")
    eq_(issue["start-date"], "08/03/2011")
    eq_(issue["due-date"], "")
    eq_(issue["assigned-to"], "-")
    eq_(issue["progress"], "0%")
    eq_(issue["category"], "Programming")
    eq_(issue["fixed-version"], "0.0.5")

    # relations
    eq_(len(issue["relations"]), 3)
    rel1 = issue["relations"][0]
    eq_(rel1["id"], "507")
    eq_(rel1["relation"], "related")

    rel2 = issue["relations"][1]
    eq_(rel2["id"], "502")
    eq_(rel2["relation"], "related")

    rel3 = issue["relations"][2]
    eq_(rel3["id"], "456")
    eq_(rel3["relation"], "blocked")

    # history
    eq_(len(issue["history"]), 1)
    hist1 = issue["history"][0]
    eq_(hist1["date"], "08/03/2011 12:37 pm")
    eq_(hist1["author"], "Caleb Davis")
    props = hist1["properties"]
    eq_(len(props), 0)
    eq_(
        hist1["comment"],
        u"I haven't gone through the code in this one yet, but the feature set is interesting: [http://pypi.python.org/pypi/cs.tags][1]\n\n   [1]: http://pypi.python.org/pypi/cs.tags\n\n",
    )
Пример #8
0
def test_383():
    """Tests that comments aren't getting wrapped"""
    rs = RedmineScraper("")
    data = open(os.path.join(get_testdata(), "383.html")).read()
    issue = rs.parse_issue(data)

    # extracted
    eq_(issue["id"], "383")

    # history
    eq_(len(issue["history"]), 1)
    hist1 = issue["history"][0]
    eq_(hist1["date"], "06/17/2011 05:46 pm")
    eq_(hist1["author"], "Jef van Schendel")
    eq_(hist1["comment"], 
        u"Hi there!\n\nAs pointed out on IRC, instead of copying the rest of the website, a black-on-white color scheme will be a better choice due to the large amounts of text in the docs.\n\nI've made a quick mockup using the colors we have right now, but with the background and text colors switched:\n\n[http://schendje.fedorapeople.org/goblin/docsTest.png][1]  \n[http://schendje.fedorapeople.org/goblin/docsTest.svg][2]\n\nI think that's a good start. As soon as I decide on the final color scheme for the website, I'll use it to make a matching one for the docs. But it'll probably look similar to this. :)\n\nJef\n\n   [1]: http://schendje.fedorapeople.org/goblin/docsTest.png\n   [2]: http://schendje.fedorapeople.org/goblin/docsTest.svg\n\n")
    props = hist1["properties"]
    eq_(len(props), 0)
Пример #9
0
def test_501():
    rs = RedmineScraper("")
    data = open(os.path.join(get_testdata(), "501.html")).read()
    issue = rs.parse_issue(data)

    # extracted
    eq_(issue["id"], "501")
    eq_(issue["title"], "Inconsistent font size specifications in css")
    eq_(issue["author"], "Jef van Schendel")
    eq_(issue["creation-date"], "08/16/2011 05:20 pm")
    eq_(issue["last-updated-date"], "08/18/2011 11:30 am")

    eq_(
        issue["description"],
        u"Base.css uses several different ways to specify text sizes. I think it has a nice mix of px, em and percentages going on right now.\n\nThis should be fixed. I'm not sure what the \"right\" way to do this is, so any help is welcome. I'll do some research and decide on what we should do, then make the needed changes.\n\nSo yeah, this bug is mostly a memory aid.\n",
    )

    # details table
    eq_(issue["priority"], "Normal")
    eq_(issue["status"], "Closed")
    eq_(issue["start-date"], "08/16/2011")
    eq_(issue["due-date"], "")
    eq_(issue["assigned-to"], "Jef van Schendel")
    eq_(issue["progress"], "0%")
    eq_(issue["category"], "Graphic Design / UI")
    eq_(issue["fixed-version"], "0.0.5")

    # history

    # there's only one history item and it's a status change from New
    # to Closed with a comment.
    eq_(len(issue["history"]), 1)
    hist1 = issue["history"][0]
    eq_(hist1["date"], "08/18/2011 11:30 am")
    eq_(hist1["author"], "Jef van Schendel")
    eq_(hist1["properties"][0], {"property": "Status", "oldvalue": "New", "newvalue": "Closed"})
    eq_(
        hist1["comment"],
        u"This has been fixed. We now use relative sizes (em) everywhere.\n\nI've also cleaned up a few things: removed some unnecssary text size values and added some spacing.\n",
    )
Пример #10
0
def test_733():
    rs = RedmineScraper("")
    data = open(os.path.join(get_testdata(), "733.html")).read()
    issue = rs.parse_issue(data)

    # extracted
    eq_(issue["id"], "733")
    eq_(issue["title"], u'Comment-field-opening \u201cAdd one\u201d button is useless/broken/confusing when JavaScript is disabled')
    eq_(issue["author"], u'Aleksej Serdjukov')
    eq_(issue["creation-date"], u'01/08/2012 10:24 am')
    eq_(issue["last-updated-date"], u'01/10/2012 09:41 am')

    eq_(issue["description"], u'The button (right above the comment field) is intended for users who will have to log in to comment. ( \n')

    # details table
    eq_(issue["priority"], "Normal")
    eq_(issue["status"], "New")
    eq_(issue["start-date"], "01/08/2012")
    eq_(issue["due-date"], "")
    eq_(issue["assigned-to"], "Jef van Schendel")
    eq_(issue["progress"], "0%")
    eq_(issue["category"], "Programming")
    eq_(issue["fixed-version"], "-")

    # history
    eq_(len(issue["history"]), 6)

    hist1 = issue["history"][0]
    eq_(hist1["date"], "01/08/2012 10:41 am")
    eq_(hist1["author"], "Jef van Schendel")
    props = hist1["properties"]
    eq_(len(props), 0)

    hist2 = issue["history"][1]
    eq_(hist2["date"], "01/08/2012 11:00 am")
    eq_(hist2["author"], "Aleksej Serdjukov")
    props = hist2["properties"]
    eq_(len(props), 0)
Пример #11
0
def test_503():
    rs = RedmineScraper("http://bugs.foocorp.net/")
    data = open(os.path.join(get_testdata(), "503.html")).read()
    issue = rs.parse_issue(data)

    # extracted
    eq_(issue["id"], "503")
    eq_(issue["title"], 'If there are no next and previous media, the navigation buttons should not appear')
    eq_(issue["author"], "Jef van Schendel")
    eq_(issue["creation-date"], "08/20/2011 05:32 pm")
    eq_(issue["last-updated-date"], "08/22/2011 09:29 am")

    eq_(issue["description"], u'Speaks for itself. If you only have one piece of media for whatever reason, the navigation still shows up. But both of the buttons are disabled, so they may just as well be gone completely.\n\nI have no idea how hard this is to do though.\n\nAttached is a screenshot.\n')

    # details table
    eq_(issue["priority"], "Normal")
    eq_(issue["status"], "Feedback")
    eq_(issue["start-date"], "08/20/2011")
    eq_(issue["due-date"], "")
    eq_(issue["assigned-to"], "Caleb Davis")
    eq_(issue["progress"], "90%")
    eq_(issue["category"], "Programming")
    eq_(issue["fixed-version"], "-")

    # attachments
    eq_(len(issue["attachments"]), 1)
    att1 = issue["attachments"][0]

    eq_(att1["author"], "Jef van Schendel")
    eq_(att1["date"], "08/20/2011 05:32 pm")
    eq_(att1["url"], "http://bugs.foocorp.net/attachments/73/Screenshot-16.png")
    eq_(att1["name"], "Screenshot-16.png")

    # history
    eq_(len(issue["history"]), 5)

    hist1 = issue["history"][0]
    eq_(hist1["date"], "08/20/2011 05:33 pm")
    eq_(hist1["author"], "Jef van Schendel")
    props = hist1["properties"]
    eq_(len(props), 0)
    eq_(hist1["comment"], u'Typo in the ticket title: "not disappear" should of course be "not appear".\n')

    hist2 = issue["history"][1]
    eq_(hist2["date"], "08/20/2011 10:37 pm")
    eq_(hist2["author"], "Caleb Davis")
    props = hist2["properties"]
    eq_(props[0], {
            "property": "Subject",
            "oldvalue": "If there are no next and previous media, the navigation buttons should not disappear",
            "newvalue": "If there are no next and previous media, the navigation buttons should not appear"
            })
    eq_(hist2["comment"], "")

    hist3 = issue["history"][2]
    eq_(hist3["date"], "08/21/2011 01:18 am")
    eq_(hist3["author"], "Caleb Davis")
    props = hist3["properties"]
    eq_(len(props), 3)
    eq_(props[0], {
            "property": "Status",
            "oldvalue": "New",
            "newvalue": "Feedback",
            })
    eq_(props[1], {
            "property": "Assigned to",
            "oldvalue": "",
            "newvalue": "Caleb Davis",
            })
    eq_(props[2], {
            "property": "% Done",
            "oldvalue": "0",
            "newvalue": "50",
            })
    eq_(hist3["comment"], u"Jef, like this?\n\n[https://gitorious.org/~cfdv/mediagoblin/cfdvs-mediagoblin/commit/e3df834a8a22a45ba77940efbd083c7d5a23764e][1]\n\nEDIT: Chris pointed out you didn't want the Xs to go away completely, just in the case where the user had one media item only. Oops! How about this one?\n\n[https://gitorious.org/~cfdv/mediagoblin/cfdvs-mediagoblin/commit/0a100476b24d81355342cae5320e1a5a6c83014d][2]\n\n   [1]: https://gitorious.org/~cfdv/mediagoblin/cfdvs-mediagoblin/commit/e3df834a8a22a45ba77940efbd083c7d5a23764e\n   [2]: https://gitorious.org/~cfdv/mediagoblin/cfdvs-mediagoblin/commit/0a100476b24d81355342cae5320e1a5a6c83014d\n\n")