def test_basic(self): url = ("http://gd2.mlb.com/components/game/mlb/year_2012/" + "month_03/day_11/gid_2012_03_11_chamlb_colmlb_1/linescore.xml") test_texts = [ '''Copyright 2012 MLB Advanced Media, L.P.''', '''home_name_abbrev="COL"''', '''away_code="cha"''', '''gameday_link="2012_03_11_chamlb_colmlb_1"''', '''winning_pitcher first_name="Jamie" first="Jamie" id="119469"''' ] text = download._get_url(url) for test_text in test_texts: assert test_text in text
def test_nonexistent_url(self): url = ("http://gd2.mlb.com/components/game/mlb/year_2012/" + "month_03/day_11/gid_2012_03_11_chamlb_colmlb_1/linesgfcore.xml") download._get_url(url)