def test_read_config_multi_missing1(self):
     with tempfile.NamedTemporaryFile(mode='wb') as t1:
         pass
     with tempfile.NamedTemporaryFile(mode='wb') as t2:
         d2 = {"x": {"y": [8, 9]}}
         t2.write(json.dumps(d2))
         t2.flush()
         result = oca.read_config([t1.name, t2.name])
         self.assertEqual(d2, result)
 def test_read_config_multi_missing1(self):
     with tempfile.NamedTemporaryFile(mode='wb') as t1:
         pass
     with tempfile.NamedTemporaryFile(mode='wb') as t2:
         d2 = {"x": {"y": [8, 9]}}
         t2.write(json.dumps(d2))
         t2.flush()
         result = oca.read_config([t1.name, t2.name])
         self.assertEqual(d2, result)
 def test_read_config_multi(self):
     with tempfile.NamedTemporaryFile(mode='wb') as t1:
         with tempfile.NamedTemporaryFile(mode='wb') as t2:
             d1 = {"a": {"b": [1, 2]}}
             d2 = {"x": {"y": [8, 9]}}
             t1.write(json.dumps(d1))
             t1.flush()
             t2.write(json.dumps(d2))
             t2.flush()
             result = oca.read_config([t1.name, t2.name])
             self.assertEqual(d1, result)
 def test_read_config_multi(self):
     with tempfile.NamedTemporaryFile(mode='wb') as t1:
         with tempfile.NamedTemporaryFile(mode='wb') as t2:
             d1 = {"a": {"b": [1, 2]}}
             d2 = {"x": {"y": [8, 9]}}
             t1.write(json.dumps(d1))
             t1.flush()
             t2.write(json.dumps(d2))
             t2.flush()
             result = oca.read_config([t1.name, t2.name])
             self.assertEqual(d1, result)
def test_read_config_no_file():
    read_config("/nosuchfile")
def test_read_config_bad_json():
    with tempfile.NamedTemporaryFile() as t:
        t.write("{{{{")
        t.flush()
        read_config(t.name)
def test_read_config():
    with tempfile.NamedTemporaryFile() as t:
        d = {"a": {"b": ["c", "d"]}}
        t.write(json.dumps(d))
        t.flush()
        assert_equals(read_config(t.name), d)
 def test_read_config(self):
     with tempfile.NamedTemporaryFile() as t:
         d = {"a": {"b": ["c", "d"]}}
         t.write(json.dumps(d))
         t.flush()
         self.assertEqual(oca.read_config([t.name]), d)
 def test_read_config(self):
     with tempfile.NamedTemporaryFile() as t:
         d = {"a": {"b": ["c", "d"]}}
         t.write(json.dumps(d))
         t.flush()
         self.assertEqual(oca.read_config([t.name]), d)