Gets Chrome module to a working state
- Shifts to using /tmp/hackertray.chrome for no conflicts
This commit is contained in:
parent
0586db9d72
commit
9dbc5d5ef8
|
@ -1,11 +1,12 @@
|
|||
import sqlite3
|
||||
import shutil
|
||||
import os
|
||||
|
||||
class Chrome:
|
||||
@staticmethod
|
||||
def search(urls, config_folder_path):
|
||||
HackerNews.setup()
|
||||
conn = sqlite3.connect('/tmp/chrome')
|
||||
Chrome.setup(config_folder_path)
|
||||
conn = sqlite3.connect('/tmp/hackertray.chrome')
|
||||
db = conn.cursor()
|
||||
result = []
|
||||
for url in urls:
|
||||
|
@ -14,7 +15,8 @@ class Chrome:
|
|||
result.append(False)
|
||||
else:
|
||||
result.append(True)
|
||||
os.remove('/tmp/hackertray.chrome')
|
||||
return result
|
||||
@staticmethod
|
||||
def setup():
|
||||
def setup(config_folder_path):
|
||||
shutil.copyfile(config_folder_path+'/History', '/tmp/hackertray.chrome')
|
|
@ -5,13 +5,12 @@ from hackertray import Chrome
|
|||
|
||||
class ChromeTest(unittest.TestCase):
|
||||
def runTest(self):
|
||||
self.assertTrue(True)
|
||||
'''
|
||||
config_folder_path = os.getcwd()+'/tests/'
|
||||
data = GoogleChrome.search([
|
||||
config_folder_path = os.getcwd()+'/test/'
|
||||
print config_folder_path
|
||||
data = Chrome.search([
|
||||
"https://github.com/",
|
||||
"https://news.ycombinator.com/",
|
||||
"https://github.com/captn3m0/hackertray",
|
||||
"http://invalid_url/"],
|
||||
config_folder_path)
|
||||
self.assertTrue(data == [True,True,True,False])'''
|
||||
self.assertTrue(data == [True,True,True,False])
|
Loading…
Reference in New Issue