blob: 58bea25f7ffcdd92e46fc64f4c1583d6fd50d83d [file] [log] [blame]
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from webkitpy.common.host import Host
from webkitpy.common.path_finder import PathFinder
from webkitpy.w3c.gerrit import GerritCL
from webkitpy.w3c.gerrit_mock import MockGerritAPI
class TestExporterTest(unittest.TestCase):
def test_filter_transform_patch(self):
host = Host()
finder = PathFinder(host.filesystem)
resources_path = finder.path_from_tools_scripts('webkitpy', 'w3c', 'resources')
sample_patch = host.filesystem.read_text_file(host.filesystem.join(resources_path, 'sample.patch'))
expected_patch = host.filesystem.read_text_file(host.filesystem.join(resources_path, 'expected.patch'))
cl = GerritCL({'change_id': 1}, MockGerritAPI(None, None, None))
actual_patch = cl.filter_transform_patch(sample_patch)
self.assertEqual(actual_patch, expected_patch)