Ejemplo n.º 1
0
def test_showDatastoreAccess():
    cnt = ShowBusiness.getShowCount()
    assert type(cnt) == IntType

    sh = ShowBusiness.addShow("asdf", 3, date(10, 2, 4), "asdfasdf", "asdfasfd", 10, [])
    assert ShowBusiness.getShowCount() == cnt+1
    db.delete(sh)
    assert ShowBusiness.getShowCount() == cnt
Ejemplo n.º 2
0
def test_scrapeAndStore():

    show_info = ShowScrape.parseShowPage(open(SHOW_PAGE,"r").read())
    assert len(show_info["tracks"]) > 0

    sh_cnt = ShowBusiness.getShowCount()
    show = ShowBusiness.addShow(**show_info)
    assert ShowBusiness.getShowCount() == sh_cnt+1
    assert ShowBusiness.getShow(show_info["number"]) != None
    assert ShowBusiness.getShowTrackCount(show_info["number"]) > 0
Ejemplo n.º 3
0
def addShowFromPage(show_url):
    show_url = urllib.unquote_plus(show_url)
    show_info = parseShowPage(fetchPage(show_url))
    ShowBusiness.addShow(**show_info)