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