src/nitpick/formats.py
def update_pair(self, key, raw_expected):
        """Update a key on one of the comparison dicts, with its raw expected value."""
        if isinstance(key, str):
            self.diff_dict.update({key: raw_expected})
            return

        if isinstance(key, list):
            if len(key) == 4 and isinstance(key[3], int):
                _, _, new_key, index = key
                if new_key not in self.diff_dict:
                    self.diff_dict[new_key] = []
                self.diff_dict[new_key].insert(index, raw_expected)
                return
            if len(key) == 1:
                self.diff_dict.update(unflatten({key[0]: raw_expected}))
                return

        logger.warning("Err... this is unexpected, please open an issue: key={} raw_expected={}", key, raw_expected)
Update a key on one of the comparison dicts, with its raw expected value.
Update a key on one of the comparison dicts, with its raw expected value.
Update a key on one of the comparison dicts with its raw expected value .
def update_pair(self, key, raw_expected):
        if isinstance(key, str):
            self.diff_dict.update({key: raw_expected})
            return
        if isinstance(key, list):
            if len(key) == 4 and isinstance(key[3], int):
                _, _, new_key, index = key
                if new_key not in self.diff_dict:
                    self.diff_dict[new_key] = []
                self.diff_dict[new_key].insert(index, raw_expected)
                return
            if len(key) == 1:
                self.diff_dict.update(unflatten({key[0]: raw_expected}))
                return
        logger.warning("Err... this is unexpected, please open an issue: key={} raw_expected={}", key, raw_expected)
def update_pair ( self , key , raw_expected ) : if isinstance ( key , str ) : self . diff_dict . update ( { key : raw_expected } ) return if isinstance ( key , list ) : if len ( key ) == 4 and isinstance ( key [ 3 ] , int ) : _ , _ , new_key , index = key if new_key not in self . diff_dict : self . diff_dict [ new_key ] = [ ] self . diff_dict [ new_key ] . insert ( index , raw_expected ) return if len ( key ) == 1 : self . diff_dict . update ( unflatten ( { key [ 0 ] : raw_expected } ) ) return logger . warning ( "Err... this is unexpected, please open an issue: key={} raw_expected={}" , key , raw_expected )
Update a key on one of the comparison dicts, with its raw expected value.
Update a key on one of the comparison dicts with its raw expected value .
"""Update a key on one of the comparison dicts, with its raw expected value."""
self
key
raw_expected