示例#1
0
def testDownloadFiveTermCorr():
    report = gtrends._downloadReport(
        username, password,
        ["banana", "albero", "finestra", "tutelare", "ambiente"], startDt, 1,
        1, '2m', '', '', '', '')
    lines = report[0].split("\n")
    assert "banana" in lines[0] and "albero" in lines[
        0] and "finestra" in lines[0] and "tutelare" in lines[
            0] and "ambiente" in lines[0]
示例#2
0
def testDownloadSearchType():
	report = gtrends._downloadReport(username, password, ["ciao"], startDt, 1,
				1, '2m', '', '', 'news', '')
	lines = report[0].split("\n")
	assert "News" in lines[0]

#there is no way to test TZ, so I leave this as an exercize to the reader.
# def testDownloadTZ():
# 	report = gtrends._downloadReport(username, password, ["ciao"], startDt, 1,
# 				1, '2m', '', '', '', 'America/Detroit')
# 	assert ?
示例#3
0
def testDownloadSearchType():
    report = gtrends._downloadReport(username, password, ["ciao"], startDt, 1,
                                     1, '2m', '', '', 'news', '')
    lines = report[0].split("\n")
    assert "News" in lines[0]


#there is no way to test TZ, so I leave this as an exercize to the reader.
# def testDownloadTZ():
# 	report = gtrends._downloadReport(username, password, ["ciao"], startDt, 1,
# 				1, '2m', '', '', '', 'America/Detroit')
# 	assert ?
示例#4
0
def testDownloadTwoTermCorr():
    report = gtrends._downloadReport(username, password, ["banana", "albero"],
                                     startDt, 1, 1, '2m', '', '', '', '')
    lines = report[0].split("\n")
    assert "banana" in lines[0] and "albero" in lines[0]
示例#5
0
def testDownloadGeoRight():
	report = gtrends._downloadReport(username, password, ["ciao"], startDt, 1,
				1, '2m', 'IT', '', '', '')
	lines = report[0].split("\n")
	assert "Italy" in lines[1]
示例#6
0
def testDownloadCat():
    report = gtrends._downloadReport(username, password, ["ciao"], startDt, 1,
                                     1, '2m', '', '0-7', '', '')
    assert len(report) == 1
示例#7
0
def testDownloadNum():
    report = gtrends._downloadReport(username, password, ["666"], startDt, 1,
                                     1, '2m', '', '', '', '')
    assert len(report) == 1
示例#8
0
def testDownloadUnicode():
    report = gtrends._downloadReport(username, password, [u"banana"], startDt,
                                     1, 1, '2m', '', '', '', '')
    assert len(report) == 1
示例#9
0
def testDownloadThreeFile():
    report = gtrends._downloadReport(username, password, ["banana"], startDt,
                                     3, 1, '2m', '', '', '', '')
    assert len(report) == 3
示例#10
0
def testDownloadCat():
    report = gtrends._downloadReport(username, password, ["ciao"], startDt, 1,
                                     1, '2m', '', '0-71', '', '')
    assert "Food & Drink" in report[0]
示例#11
0
def testDownloadNum():
	report = gtrends._downloadReport(username, password, ["666"], startDt, 1,
				1, '2m', '', '', '', '')
	assert len(report) == 1
示例#12
0
def testDownloadUnicodeNonLatinChar():
	report = gtrends._downloadReport(username, password, ["咖啡店"], startDt, 1,
				1, '2m', '', '', '', '')
	assert len(report) == 1
示例#13
0
def testDownloadUnicode():
	report = gtrends._downloadReport(username, password, [u"banana"], startDt, 1,
				1, '2m', '', '', '', '')
	assert len(report) == 1
示例#14
0
def testDownloadThreeTerms():
	report = gtrends._downloadReport(username, password, ["banana", "pie", "mango"], startDt, 1,
				1, '2m', '', '', '', '')
	assert len(report) == 1
示例#15
0
def testDownloadThreeFile():
	report = gtrends._downloadReport(username, password, ["banana"], startDt, 3,
				1, '2m', '', '', '', '')
	assert len(report) == 3
示例#16
0
def testDownloadCat():
	report = gtrends._downloadReport(username, password, ["ciao"], startDt, 1,
				1, '2m', '', '0-71', '', '')
	assert "Food & Drink" in report[0]
示例#17
0
def testDownloadGeoRight():
    report = gtrends._downloadReport(username, password, ["ciao"], startDt, 1,
                                     1, '2m', 'IT', '', '', '')
    lines = report[0].split("\n")
    assert "Italy" in lines[1]
示例#18
0
def testDownloadPunct():
	report = gtrends._downloadReport(username, password, "~!@#$%^&*()_+-=;':[]{]\|,<.>/?}]", startDt, 1,
				1, '2m', '', '', '', '')
	assert len(report) == 1
示例#19
0
def testDownloadCat():
	report = gtrends._downloadReport(username, password, ["ciao"], startDt, 1,
				1, '2m', '', '0-7', '', '')
	assert len(report) == 1
示例#20
0
def testDownloadSearchType():
	report = gtrends._downloadReport(username, password, ["ciao"], startDt, 1,
				1, '2m', '', '', 'news', '')
	assert len(report) == 1
示例#21
0
def testDownloadThreeTerms():
    report = gtrends._downloadReport(username, password,
                                     ["banana", "pie", "mango"], startDt, 1, 1,
                                     '2m', '', '', '', '')
    assert len(report) == 1
示例#22
0
def testDownloadTZ():
	report = gtrends._downloadReport(username, password, ["ciao"], startDt, 1,
				1, '2m', '', '', '', 'America/Detroit')
	assert len(report) == 1
示例#23
0
def testDownloadUnicodeNonLatinChar():
    report = gtrends._downloadReport(username, password, ["咖啡店"], startDt, 1,
                                     1, '2m', '', '', '', '')
    assert len(report) == 1
示例#24
0
def testDownloadOneTermCorr():
	report = gtrends._downloadReport(username, password, ["banana"], startDt, 1,
				1, '2m', '', '', '', '')
	lines = report[0].split("\n")
	assert "banana" in lines[0]
示例#25
0
def testDownloadPunct():
    report = gtrends._downloadReport(username, password,
                                     "~!@#$%^&*()_+-=;':[]{]\|,<.>/?}]",
                                     startDt, 1, 1, '2m', '', '', '', '')
    assert len(report) == 1
示例#26
0
def testDownloadTZ():
    report = gtrends._downloadReport(username, password, ["ciao"], startDt, 1,
                                     1, '2m', '', '', '', 'America/Detroit')
    assert len(report) == 1
示例#27
0
def testDownloadSearchType():
    report = gtrends._downloadReport(username, password, ["ciao"], startDt, 1,
                                     1, '2m', '', '', 'news', '')
    assert len(report) == 1
示例#28
0
def testDownloadFiveTermCorr():
	report = gtrends._downloadReport(username, password, ["banana", "albero", "finestra", "tutelare", "ambiente"], startDt, 1,
				1, '2m', '', '', '', '')
	lines = report[0].split("\n")
	assert "banana" in lines[0] and "albero" in lines[0] and "finestra" in lines[0] and "tutelare" in lines[0] and "ambiente" in lines[0]