Mustafa Emre Acer | ac34055c | 2018-03-08 22:07:44 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | # Copyright 2018 The Chromium Authors. All rights reserved. |
| 3 | # Use of this source code is governed by a BSD-style license that can be |
| 4 | # found in the LICENSE file. |
| 5 | |
| 6 | import unittest |
| 7 | import os |
| 8 | import sys |
| 9 | |
| 10 | here = os.path.realpath(__file__) |
| 11 | testdata_path = os.path.normpath(os.path.join(here, '..', 'testdata')) |
| 12 | |
| 13 | import upload_screenshots |
| 14 | |
| 15 | |
| 16 | class UploadTests(unittest.TestCase): |
| 17 | |
| 18 | def test_find_screenshots(self): |
| 19 | screenshots = upload_screenshots.find_screenshots( |
| 20 | testdata_path, |
| 21 | os.path.join(testdata_path, 'translation_expectations.pyl')) |
Mustafa Emre Acer | a4181d4 | 2018-03-22 17:45:17 | [diff] [blame] | 22 | self.assertEquals(2, len(screenshots)) |
Mustafa Emre Acer | ac34055c | 2018-03-08 22:07:44 | [diff] [blame] | 23 | self.assertEquals( |
| 24 | os.path.join(testdata_path, 'test_grd', 'IDS_TEST_STRING1.png'), |
| 25 | screenshots[0]) |
Mustafa Emre Acer | a4181d4 | 2018-03-22 17:45:17 | [diff] [blame] | 26 | self.assertEquals( |
| 27 | os.path.join(testdata_path, 'part_grdp', 'IDS_PART_STRING2.png'), |
| 28 | screenshots[1]) |
Mustafa Emre Acer | ac34055c | 2018-03-08 22:07:44 | [diff] [blame] | 29 | |
| 30 | |
| 31 | if __name__ == '__main__': |
| 32 | unittest.main() |