Пример #1
0
 def test_dag(self):
     t_a = types.Target('a', directives=[types.Call('deps', ['b', 'd'])])
     t_b = types.Target('b', directives=[types.Call('deps', ['c', 'd'])])
     t_c = types.Target('c')
     t_d = types.Target('d')
     satefile = types.Satefile((t_a, t_b, t_c, t_d))
     self.assertEqual(satefile.run_order('a'), ['c', 'd', 'b', 'a'])
Пример #2
0
 def test_two_char(self):
     self.assertEqual(rules.Call.parse('ab()'), types.Call('ab'))
Пример #3
0
 def test_one_char(self):
     self.assertEqual(rules.Call.parse('a()'), types.Call('a'))
Пример #4
0
 def test_no_args(self):
     self.assertEqual(rules.TargetTag.parse('[a b]'),
                      types.Target('a', directives=[types.Call('b')]))
Пример #5
0
 def test_call(self):
     self.assertEqual(rules.CommandTag.parse('[a()]'), [types.Call('a')])
Пример #6
0
 def test_two_char(self):
     self.assertEqual(rules.CommandTag.parse('[ab]'), [types.Call('ab')])
Пример #7
0
 def test_one_char(self):
     self.assertEqual(rules.CommandTag.parse('[a]'), [types.Call('a')])
Пример #8
0
 def test_args(self):
     self.assertEqual(rules.Call.parse('a(b c d)'),
                      types.Call('a', ['b', 'c', 'd']))
Пример #9
0
 def test_two_char_no_parens(self):
     self.assertEqual(rules.Call.parse('ab'), types.Call('ab'))
Пример #10
0
 def test_no_parens(self):
     self.assertEqual(rules.Call.parse('a'), types.Call('a'))
Пример #11
0
 def test_two_deps(self):
     target = types.Target('a', directives=[types.Call('deps', ['b', 'c'])])
     self.assertEqual(target.deps(), ['b', 'c'])
Пример #12
0
 def test_both(self):
     self.check([types.Call('deps', ['a']),
                 types.Call('b')], (['a'], [types.Call('b')]))
Пример #13
0
 def test_just_deps(self):
     self.check([types.Call('deps', ['a'])], (['a'], []))