wownero-python/tests/base.py
2019-03-12 11:27:46 +01:00

15 lines
448 B
Python

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())