| # Copyright 2022 The Chromium Authors |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| import compare_build_artifacts |
| class Test(unittest.TestCase): |
| def test_diff_binary(self): |
| with tempfile.TemporaryDirectory() as dir: |
| filea = os.path.join(dir, 'a') |
| fileb = os.path.join(dir, 'b') |
| with open(filea, 'wb') as f: |
| with open(fileb, 'wb') as f: |
| compare_build_artifacts.diff_binary(filea, fileb, 1), |
| """1 out of 1 bytes are different (100.00%) |
| if __name__ == '__main__': |