Пример #1
0
 def test_no_required_prefix(self):
     ignore_conditions = action_tracer.MatchConditions()
     self.assertTrue(
         action_tracer.Read("book").should_check(
             ignore_conditions=ignore_conditions, required_path_prefix=""))
     self.assertTrue(
         action_tracer.Write("block").should_check(
             ignore_conditions=ignore_conditions, required_path_prefix=""))
Пример #2
0
 def test_no_ignored_suffix(self):
     ignore_conditions = action_tracer.MatchConditions(suffixes={})
     self.assertTrue(
         action_tracer.Read("book").should_check(
             ignore_conditions=ignore_conditions))
     self.assertTrue(
         action_tracer.Write("output/log").should_check(
             ignore_conditions=ignore_conditions))
Пример #3
0
 def test_ignored_prefix_matches(self):
     ignore_conditions = action_tracer.MatchConditions(prefixes={"/tmp"})
     self.assertFalse(
         action_tracer.Read("/tmp/book").should_check(
             ignore_conditions=ignore_conditions))
     self.assertFalse(
         action_tracer.Write("/tmp/log").should_check(
             ignore_conditions=ignore_conditions))
Пример #4
0
 def test_ignored_path_components_matches(self):
     ignore_conditions = action_tracer.MatchConditions(
         components={"__auto__", ".generated"})
     self.assertFalse(
         action_tracer.Read("library/__auto__/book").should_check(
             ignore_conditions=ignore_conditions))
     self.assertFalse(
         action_tracer.Write(".generated/out/log").should_check(
             ignore_conditions=ignore_conditions))
Пример #5
0
 def test_ignored_path_components_no_match(self):
     ignore_conditions = action_tracer.MatchConditions(
         components={"__auto__", ".generated"})
     self.assertTrue(
         action_tracer.Read("book").should_check(
             ignore_conditions=ignore_conditions))
     self.assertTrue(
         action_tracer.Write("out/log").should_check(
             ignore_conditions=ignore_conditions))
Пример #6
0
 def test_ignored_suffix_matches(self):
     # e.g. from compiler --save-temps
     ignore_conditions = action_tracer.MatchConditions(suffixes={".ii"})
     self.assertFalse(
         action_tracer.Read("book.ii").should_check(
             ignore_conditions=ignore_conditions))
     self.assertFalse(
         action_tracer.Write("tmp/log.ii").should_check(
             ignore_conditions=ignore_conditions))
Пример #7
0
 def test_ignored_prefix_no_match(self):
     ignore_conditions = action_tracer.MatchConditions(
         prefixes={"/tmp", "/no/look/here"})
     self.assertTrue(
         action_tracer.Read("book").should_check(
             ignore_conditions=ignore_conditions))
     self.assertTrue(
         action_tracer.Write("out/log").should_check(
             ignore_conditions=ignore_conditions))
Пример #8
0
 def test_ignored_suffix_no_match(self):
     # e.g. from compiler --save-temps
     ignore_conditions = action_tracer.MatchConditions(
         suffixes={".ii", ".S"})
     self.assertTrue(
         action_tracer.Read("book.txt").should_check(
             ignore_conditions=ignore_conditions))
     self.assertTrue(
         action_tracer.Write("out/process.log").should_check(
             ignore_conditions=ignore_conditions))
Пример #9
0
 def test_required_prefix_no_match(self):
     ignore_conditions = action_tracer.MatchConditions()
     prefix = "/home/project"
     self.assertFalse(
         action_tracer.Read("book").should_check(
             ignore_conditions=ignore_conditions,
             required_path_prefix=prefix))
     self.assertFalse(
         action_tracer.Write("output/log").should_check(
             ignore_conditions=ignore_conditions,
             required_path_prefix=prefix))
Пример #10
0
 def test_required_prefix_matches(self):
     ignore_conditions = action_tracer.MatchConditions()
     prefix = "/home/project"
     self.assertTrue(
         action_tracer.Read("/home/project/book").should_check(
             ignore_conditions=ignore_conditions,
             required_path_prefix=prefix))
     self.assertTrue(
         action_tracer.Write("/home/project/out/block").should_check(
             ignore_conditions=ignore_conditions,
             required_path_prefix=prefix))
Пример #11
0
 def test_component_matches(self):
     self.assertTrue(
         action_tracer.MatchConditions(
             components={"bar", "bq"}).matches("foo/bar/baz.txt"))
Пример #12
0
 def test_suffix_matches(self):
     self.assertTrue(
         action_tracer.MatchConditions(suffixes={"ar"}).matches("foo/bar"))
Пример #13
0
 def test_no_conditions(self):
     self.assertFalse(action_tracer.MatchConditions().matches("foo/bar"))