wownero-python/tests/base.py

16 lines
448 B
Python
Raw Normal View History

2019-03-12 10:07:38 +00:00
import json
import os
import unittest
class JSONTestCase(unittest.TestCase):
jsonrpc_url = 'http://127.0.0.1:18088/json_rpc'
data_subdir = None
def _read(self, *args):
path = os.path.join(os.path.dirname(__file__), 'data')
if self.data_subdir:
path = os.path.join(path, self.data_subdir)
path = os.path.join(path, *args)
with open(path, 'r') as fh:
return json.loads(fh.read())