def test_keeps_owners_files_and_baselines(self):
     host = MockHost()
     dest_path = '/mock-checkout/third_party/WebKit/LayoutTests/external/wpt'
     host.filesystem.write_text_file(dest_path + '/foo-test.html', '')
     host.filesystem.write_text_file(dest_path + '/foo-test-expected.txt', '')
     host.filesystem.write_text_file(dest_path + '/OWNERS', '')
     host.filesystem.write_text_file(dest_path + '/bar/baz/OWNERS', '')
     importer = TestImporter(host)
     importer._clear_out_dest_path(dest_path)
     self.assertFalse(host.filesystem.exists(dest_path + '/foo-test.html'))
     self.assertTrue(host.filesystem.exists(dest_path + '/foo-test-expected.txt'))
     self.assertTrue(host.filesystem.exists(dest_path + '/OWNERS'))
     self.assertTrue(host.filesystem.exists(dest_path + '/bar/baz/OWNERS'))
Пример #2
0
 def test_clear_out_dest_path(self):
     host = MockHost()
     dest_path = '/mock-checkout/third_party/WebKit/LayoutTests/external/wpt'
     host.filesystem.write_text_file(dest_path + '/foo-test.html', '')
     host.filesystem.write_text_file(dest_path + '/foo-test-expected.txt', '')
     host.filesystem.write_text_file(dest_path + '/OWNERS', '')
     host.filesystem.write_text_file(dest_path + '/bar/baz/OWNERS', '')
     importer = TestImporter(host)
     # When the destination path is cleared, OWNERS files and baselines
     # are kept.
     importer._clear_out_dest_path(dest_path)
     self.assertFalse(host.filesystem.exists(dest_path + '/foo-test.html'))
     self.assertTrue(host.filesystem.exists(dest_path + '/foo-test-expected.txt'))
     self.assertTrue(host.filesystem.exists(dest_path + '/OWNERS'))
     self.assertTrue(host.filesystem.exists(dest_path + '/bar/baz/OWNERS'))
 def test_clear_out_dest_path(self):
     host = MockHost()
     importer = TestImporter(host)
     dest_path = importer.dest_path
     host.filesystem.write_text_file(dest_path + '/foo-test.html', '')
     host.filesystem.write_text_file(dest_path + '/foo-test-expected.txt', '')
     host.filesystem.write_text_file(dest_path + '/OWNERS', '')
     host.filesystem.write_text_file(dest_path + '/bar/baz/OWNERS', '')
     # When the destination path is cleared, OWNERS files and baselines
     # are kept.
     importer._clear_out_dest_path()
     self.assertFalse(host.filesystem.exists(dest_path + '/foo-test.html'))
     self.assertTrue(host.filesystem.exists(dest_path + '/foo-test-expected.txt'))
     self.assertTrue(host.filesystem.exists(dest_path + '/OWNERS'))
     self.assertTrue(host.filesystem.exists(dest_path + '/bar/baz/OWNERS'))