Esempio n. 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]
Esempio n. 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 ?
Esempio n. 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 ?
Esempio n. 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]
Esempio n. 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]
Esempio n. 6
0
def testDownloadCat():
    report = gtrends._downloadReport(username, password, ["ciao"], startDt, 1,
                                     1, '2m', '', '0-7', '', '')
    assert len(report) == 1
Esempio n. 7
0
def testDownloadNum():
    report = gtrends._downloadReport(username, password, ["666"], startDt, 1,
                                     1, '2m', '', '', '', '')
    assert len(report) == 1
Esempio n. 8
0
def testDownloadUnicode():
    report = gtrends._downloadReport(username, password, [u"banana"], startDt,
                                     1, 1, '2m', '', '', '', '')
    assert len(report) == 1
Esempio n. 9
0
def testDownloadThreeFile():
    report = gtrends._downloadReport(username, password, ["banana"], startDt,
                                     3, 1, '2m', '', '', '', '')
    assert len(report) == 3
Esempio n. 10
0
def testDownloadCat():
    report = gtrends._downloadReport(username, password, ["ciao"], startDt, 1,
                                     1, '2m', '', '0-71', '', '')
    assert "Food & Drink" in report[0]
Esempio n. 11
0
def testDownloadNum():
	report = gtrends._downloadReport(username, password, ["666"], startDt, 1,
				1, '2m', '', '', '', '')
	assert len(report) == 1
Esempio n. 12
0
def testDownloadUnicodeNonLatinChar():
	report = gtrends._downloadReport(username, password, ["咖啡店"], startDt, 1,
				1, '2m', '', '', '', '')
	assert len(report) == 1
Esempio n. 13
0
def testDownloadUnicode():
	report = gtrends._downloadReport(username, password, [u"banana"], startDt, 1,
				1, '2m', '', '', '', '')
	assert len(report) == 1
Esempio n. 14
0
def testDownloadThreeTerms():
	report = gtrends._downloadReport(username, password, ["banana", "pie", "mango"], startDt, 1,
				1, '2m', '', '', '', '')
	assert len(report) == 1
Esempio n. 15
0
def testDownloadThreeFile():
	report = gtrends._downloadReport(username, password, ["banana"], startDt, 3,
				1, '2m', '', '', '', '')
	assert len(report) == 3
Esempio n. 16
0
def testDownloadCat():
	report = gtrends._downloadReport(username, password, ["ciao"], startDt, 1,
				1, '2m', '', '0-71', '', '')
	assert "Food & Drink" in report[0]
Esempio n. 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]
Esempio n. 18
0
def testDownloadPunct():
	report = gtrends._downloadReport(username, password, "~!@#$%^&*()_+-=;':[]{]\|,<.>/?}]", startDt, 1,
				1, '2m', '', '', '', '')
	assert len(report) == 1
Esempio n. 19
0
def testDownloadCat():
	report = gtrends._downloadReport(username, password, ["ciao"], startDt, 1,
				1, '2m', '', '0-7', '', '')
	assert len(report) == 1
Esempio n. 20
0
def testDownloadSearchType():
	report = gtrends._downloadReport(username, password, ["ciao"], startDt, 1,
				1, '2m', '', '', 'news', '')
	assert len(report) == 1
Esempio n. 21
0
def testDownloadThreeTerms():
    report = gtrends._downloadReport(username, password,
                                     ["banana", "pie", "mango"], startDt, 1, 1,
                                     '2m', '', '', '', '')
    assert len(report) == 1
Esempio n. 22
0
def testDownloadTZ():
	report = gtrends._downloadReport(username, password, ["ciao"], startDt, 1,
				1, '2m', '', '', '', 'America/Detroit')
	assert len(report) == 1
Esempio n. 23
0
def testDownloadUnicodeNonLatinChar():
    report = gtrends._downloadReport(username, password, ["咖啡店"], startDt, 1,
                                     1, '2m', '', '', '', '')
    assert len(report) == 1
Esempio n. 24
0
def testDownloadOneTermCorr():
	report = gtrends._downloadReport(username, password, ["banana"], startDt, 1,
				1, '2m', '', '', '', '')
	lines = report[0].split("\n")
	assert "banana" in lines[0]
Esempio n. 25
0
def testDownloadPunct():
    report = gtrends._downloadReport(username, password,
                                     "~!@#$%^&*()_+-=;':[]{]\|,<.>/?}]",
                                     startDt, 1, 1, '2m', '', '', '', '')
    assert len(report) == 1
Esempio n. 26
0
def testDownloadTZ():
    report = gtrends._downloadReport(username, password, ["ciao"], startDt, 1,
                                     1, '2m', '', '', '', 'America/Detroit')
    assert len(report) == 1
Esempio n. 27
0
def testDownloadSearchType():
    report = gtrends._downloadReport(username, password, ["ciao"], startDt, 1,
                                     1, '2m', '', '', 'news', '')
    assert len(report) == 1
Esempio n. 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]