Example #1
0
 def test_select_include_any_tags(self):
     config = selector._SelectorConfig(roots=[
         "dir/subdir1/*.js", "dir/subdir2/*.js", "dir/subdir3/a/*.js"
     ],
                                       include_with_any_tags=["tag1"])
     selected = self.selector.select(config)
     self.assertEqual([], selected)
Example #2
0
 def test_select_include_files(self):
     config = selector._SelectorConfig(
         roots=[
             "dir/subdir1/*.js", "dir/subdir2/*.js", "dir/subdir3/a/*.js"
         ],
         include_files=["dir/subdir2/test21.js"])
     selected = self.selector.select(config)
     self.assertEqual(["dir/subdir2/test21.js"], selected)
Example #3
0
 def test_select_include_files(self):
     config = selector._SelectorConfig(
         roots=["dir/subdir1/*.js", "dir/subdir2/*.js",
                "dir/subdir3/a/*.js"], include_files=["dir/subdir2/test21.js"])
     selected, excluded = self.selector.select(config)
     self.assertEqual(["dir/subdir2/test21.js"], selected)
     self.assertEqual(
         ["dir/subdir1/test11.js", "dir/subdir1/test12.js", "dir/subdir3/a/test3a1.js"],
         excluded)
Example #4
0
 def test_select_all(self):
     config = selector._SelectorConfig(roots=[
         "dir/subdir1/*.js", "dir/subdir2/*.js", "dir/subdir3/a/*.js"
     ])
     selected = self.selector.select(config)
     self.assertEqual([
         "dir/subdir1/test11.js", "dir/subdir1/test12.js",
         "dir/subdir2/test21.js", "dir/subdir3/a/test3a1.js"
     ], selected)
 def test_select_include_tags(self):
     config = selector._SelectorConfig(
         roots=["dir/subdir1/*.js", "dir/subdir2/*.js", "dir/subdir3/a/*.js"],
         include_tags="tag1")
     selected, excluded = self.selector.select(config)
     self.assertEqual([], selected)
     self.assertEqual([
         "dir/subdir1/test11.js", "dir/subdir1/test12.js", "dir/subdir2/test21.js",
         "dir/subdir3/a/test3a1.js"
     ], excluded)
Example #6
0
 def test_include_exclude_tags(self):
     with self.assertRaises(ValueError):
         selector._SelectorConfig(include_tags="tag1", exclude_tags="tag2")
Example #7
0
 def test_root_roots(self):
     with self.assertRaises(ValueError):
         selector._SelectorConfig(root="path_to_root", roots=["test1", "test2"])
Example #8
0
 def test_include_exclude_tags(self):
     with self.assertRaises(ValueError):
         selector._SelectorConfig(include_tags="tag1", exclude_tags="tag2")
Example #9
0
 def test_root_roots(self):
     with self.assertRaises(ValueError):
         selector._SelectorConfig(root="path_to_root",
                                  roots=["test1", "test2"])