コード例 #1
0
    def assertHexDifferentAt(first, second, positions, message):
        _, _, differences_at_position = diff(first, second)
        if len(differences_at_position) == 0:
            print("Hexs are equal")
            failure(first, second, message)

        if isinstance(positions, int):
            if len(differences_at_position) != 1 or (
                    positions not in differences_at_position):
                show_diff(first, second, index=True)
                failure(first, second, message)
        elif isinstance(positions, (list, tuple)):
            if not set(positions).issubset(
                    set(differences_at_position)) or set(positions) < set(
                        differences_at_position):
                show_diff(first, second, index=True)
                failure(first, second, message)
コード例 #2
0
 def test_show_more_diff(self):
     show_diff(self.ether, "ff ff ff ff ff ff 00 00 00 00 00 00 90 00")
コード例 #3
0
 def assertHexLenNotEqual(first, second, message=None):
     len_first, len_second = len(get_hex(first)), len(get_hex(second))
     if len_first == len_second:
         show_diff(first, second)
         failure(first, second, message)
コード例 #4
0
 def assertHexNotEqual(first, second, message=None):
     if hex_equal(first, second, show_inequalities=False):
         show_diff(first, second)
         failure(first, second, message)