@@ 570-584 (lines=15) @@ | ||
567 | self.assertTrue(os.path.exists(self.a_path)) |
|
568 | self.assertTrue(os.path.exists(self.b_path)) |
|
569 | ||
570 | res = TT.load(self.a_path) |
|
571 | self.assert_dicts_equal(res, self.dic) |
|
572 | ||
573 | res = TT.load(self.g_path) |
|
574 | self.assert_dicts_equal(res, self.exp) |
|
575 | ||
576 | res = TT.load([self.a_path, self.b_path]) |
|
577 | self.assert_dicts_equal(res, self.exp) |
|
578 | ||
579 | def test_31_dump_and_load__to_from_stream(self): |
|
580 | with TT.open(self.a_path, mode='w') as strm: |
|
581 | TT.dump(self.dic, strm) |
|
582 | ||
583 | self.assertTrue(os.path.exists(self.a_path)) |
|
584 | ||
585 | with TT.open(self.a_path) as strm: |
|
586 | res = TT.load(strm, ac_parser="json") |
|
587 | self.assert_dicts_equal(res, self.dic) |
|
@@ 432-446 (lines=15) @@ | ||
429 | self.assertTrue(os.path.exists(self.a_path)) |
|
430 | self.assertTrue(os.path.exists(self.b_path)) |
|
431 | ||
432 | res0 = TT.multi_load(self.g_path, ac_merge=merge) |
|
433 | res1 = TT.multi_load([self.g_path, self.b_path], ac_merge=merge) |
|
434 | ||
435 | self.assertTrue(res0) |
|
436 | self.assertTrue(res1) |
|
437 | ||
438 | self.assert_dicts_equal(res0, exp) |
|
439 | self.assert_dicts_equal(res1, exp) |
|
440 | ||
441 | def test_10_default_merge_strategy(self): |
|
442 | exp = copy.deepcopy(self.upd) |
|
443 | exp["b"]["c"] = self.dic["b"]["c"] |
|
444 | exp["name"] = self.dic["name"] |
|
445 | ||
446 | self._check_multi_load_with_strategy(exp, merge=None) |
|
447 | self._check_multi_load_with_strategy(exp) |
|
448 | ||
449 | def test_20_merge_dicts_and_lists(self): |