-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure blinkpy mock text files encode to and decode from bytes
This change ensures all file contents in MockFileSystem are stored internally as bytes. Previously, open_text_file_for_{reading,writing} assumed file contents were Unicode strings, while {read,write}_text_file assumed contents were bytes. Calling a write method from one pair with the read method from the other caused type errors. This change also removes direct accesses in the unit tests to MockFileSystem.files. The unit tests sometimes incorrectly wrote Unicode strings as well. Bug: 1307533 Test: vpython run_blinkpy_tests.py Test: vpython3 run_blinkpy_tests.py Change-Id: Ic15bc378817a7c928e473361108eb62525ea31c5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3538824 Reviewed-by: Weizhong Xia <weizhong@google.com> Commit-Queue: Jonathan Lee <jonathanjlee@google.com> Cr-Commit-Position: refs/heads/main@{#983944}
- Loading branch information
1 parent
e1804dd
commit 249ab8d
Showing
10 changed files
with
144 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.