Fix branches types in tests
branch names and targets are expected to be bytes. This should allow to get rid of the type castings in check_snapshot().