Try to fix loading of JSON files in tests on Travis
This commit is contained in:
parent
5a008e7e77
commit
d3f5361f4d
1 changed files with 6 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
import json
|
import json
|
||||||
|
import os
|
||||||
|
|
||||||
from twython import Twython, TwythonError
|
from twython import Twython, TwythonError
|
||||||
|
|
||||||
|
|
@ -11,7 +12,11 @@ class TestHtmlForTweetTestCase(unittest.TestCase):
|
||||||
self.api = Twython('', '', '', '')
|
self.api = Twython('', '', '', '')
|
||||||
|
|
||||||
def load_tweet(self, name):
|
def load_tweet(self, name):
|
||||||
f = open('tests/tweets/%s.json' % name)
|
f = open(os.path.join(
|
||||||
|
os.path.dirname(__file__),
|
||||||
|
'tweets',
|
||||||
|
'%s.json' % name
|
||||||
|
))
|
||||||
tweet = json.load(f)
|
tweet = json.load(f)
|
||||||
f.close()
|
f.close()
|
||||||
return tweet
|
return tweet
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue