remove test_bot

test bot was moved to keynes repo, and shouldn’t be with the tests
script
This commit is contained in:
Jack 2016-05-30 16:14:32 -04:00
parent 2026024c8a
commit 0151dd8875
2 changed files with 1 additions and 61 deletions

View file

@ -39,7 +39,7 @@ rm get-pip.py
pip install -r requirements.txt
pip install nose coverage coveralls pylint
nosetests --with-coverage --cover-package=lbrynet -v -I lbrynet_test_bot.py -I functional_tests.py tests/
nosetests --with-coverage --cover-package=lbrynet -v -I functional_tests.py tests/
# TODO: submit coverage report to coveralls
# TODO: as code quality improves, make pylint be more strict

View file

@ -1,60 +0,0 @@
import xmlrpclib
import json
from datetime import datetime
from time import sleep
from slackclient import SlackClient
def get_conf():
f = open('testbot.conf', 'r')
token = f.readline().replace('\n', '')
f.close()
return token
def test_lbrynet(lbry, slack, channel):
logfile = open('lbrynet_test_log.txt', 'a')
try:
path = lbry.get('testlbrynet')['path']
except:
msg = '[' + str(datetime.now()) + '] ! Failed to obtain LBRYnet test file'
slack.rtm_connect()
slack.rtm_send_message(channel, msg)
print msg
logfile.write(msg + '\n')
file_name = path.split('/')[len(path.split('/'))-1]
for n in range(10):
files = [f for f in lbry.get_lbry_files() if (json.loads(f)['file_name'] == file_name) and json.loads(f)['completed']]
if files:
break
sleep(30)
if files:
msg = '[' + str(datetime.now()) + '] LBRYnet download test successful'
slack.rtm_connect()
# slack.rtm_send_message(channel, msg)
print msg
logfile.write(msg + '\n')
else:
msg = '[' + str(datetime.now()) + '] ! Failed to obtain LBRYnet test file'
slack.rtm_connect()
slack.rtm_send_message(channel, msg)
print msg
logfile.write(msg + '\n')
lbry.delete_lbry_file('test.jpg')
logfile.close()
token = get_conf()
sc = SlackClient(token)
sc.rtm_connect()
channel = [c['id'] for c in json.loads(sc.api_call('channels.list'))['channels'] if c['name'] == 'tech'][0]
print 'Connected to slack'
daemon = xmlrpclib.ServerProxy("http://localhost:7080")
while True:
test_lbrynet(daemon, sc, channel)
sleep(600)