def load(fname): """ Convert a exa configuration format to its dictionary representation Can raise InvalidFormat and all file related exceptions such as IOError """ with Reader(fname) as reader: return json.load(reader)
def load (fname): """ Convert a exa configuration format to its dictionary representation Can raise InvalidFormat and all file related exceptions such as IOError """ with Reader(fname) as reader: return json.load(reader)
def test (): from exabgp.configuration.json import load,JSONError try: name = _make_config() except: return 'could not create temp file' try: json = load(name) except JSONError,e: os.remove(name) return 'configuration parsing file: %s' % str(e)
def test(): from exabgp.configuration.json import load, JSONError try: name = _make_config() except: return 'could not create temp file' try: json = load(name) except JSONError, e: os.remove(name) return 'configuration parsing file: %s' % str(e)
f.write(configuration) print 'created' return name def test (): from exabgp.configuration.json import load from exabgp.configuration.json import JSONError try: name = _make_config() except: return 'could not create temp file' try: json = load(name) except JSONError,e: os.remove(name) return 'configuration parsing file: %s' % str(e) del json class TestData (unittest.TestCase): def test_1 (self): if not os.environ.get('profile',False): result = test() if result: self.fail(result) def test_2 (self): if not not os.environ.get('profile',False):