Code Duplication    Length = 14-14 lines in 2 locations

tests/test_keypath_dict.py 2 locations

@@ 677-690 (lines=14) @@
674
        del b['a', 'b', 'c']
675
        self.assertEqual(b.get('a.b.c', 3), 3)
676
677
    def test_delitem_with_keys_list_and_no_keypath_separator(self):
678
        d = {
679
            'a': {
680
                'b': {
681
                    'c': 1,
682
                    'd': 2,
683
                },
684
            }
685
        }
686
        b = KeypathDict(d, keypath_separator=None)
687
        with self.assertRaises(KeyError):
688
            del b['a', 'b', 'c', 'd']
689
        del b['a', 'b', 'c']
690
        self.assertEqual(b.get('a.b.c', 3), 3)
691
692
    def test_pop_default(self):
693
        d = {
@@ 662-675 (lines=14) @@
659
            del b['a.b.c.d']
660
        self.assertEqual(b.get('a.b.c'), 1)
661
662
    def test_delitem_with_keys_list(self):
663
        d = {
664
            'a': {
665
                'b': {
666
                    'c': 1,
667
                    'd': 2,
668
                },
669
            }
670
        }
671
        b = KeypathDict(d)
672
        with self.assertRaises(KeyError):
673
            del b['a', 'b', 'c', 'd']
674
        del b['a', 'b', 'c']
675
        self.assertEqual(b.get('a.b.c', 3), 3)
676
677
    def test_delitem_with_keys_list_and_no_keypath_separator(self):
678
        d = {