forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_apps_test.py
More file actions
62 lines (46 loc) · 1.46 KB
/
test_apps_test.py
File metadata and controls
62 lines (46 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Copyright 2020 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.
"""Unittests for test_apps.py."""
import unittest
import test_apps
import test_runner_test
class GetKIFTestFilterTest(test_runner_test.TestCase):
"""Tests for test_runner.get_kif_test_filter."""
def test_correct(self):
"""Ensures correctness of filter."""
tests = [
'KIF.test1',
'KIF.test2',
]
expected = 'NAME:test1|test2'
self.assertEqual(expected, test_apps.get_kif_test_filter(tests))
def test_correct_inverted(self):
"""Ensures correctness of inverted filter."""
tests = [
'KIF.test1',
'KIF.test2',
]
expected = '-NAME:test1|test2'
self.assertEqual(expected,
test_apps.get_kif_test_filter(tests, invert=True))
class GetGTestFilterTest(test_runner_test.TestCase):
"""Tests for test_runner.get_gtest_filter."""
def test_correct(self):
"""Ensures correctness of filter."""
tests = [
'test.1',
'test.2',
]
expected = 'test.1:test.2'
self.assertEqual(test_apps.get_gtest_filter(tests), expected)
def test_correct_inverted(self):
"""Ensures correctness of inverted filter."""
tests = [
'test.1',
'test.2',
]
expected = '-test.1:test.2'
self.assertEqual(test_apps.get_gtest_filter(tests, invert=True), expected)
if __name__ == '__main__':
unittest.main()