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'])
def test_two_char(self): self.assertEqual(rules.Call.parse('ab()'), types.Call('ab'))
def test_one_char(self): self.assertEqual(rules.Call.parse('a()'), types.Call('a'))
def test_no_args(self): self.assertEqual(rules.TargetTag.parse('[a b]'), types.Target('a', directives=[types.Call('b')]))
def test_call(self): self.assertEqual(rules.CommandTag.parse('[a()]'), [types.Call('a')])
def test_two_char(self): self.assertEqual(rules.CommandTag.parse('[ab]'), [types.Call('ab')])
def test_one_char(self): self.assertEqual(rules.CommandTag.parse('[a]'), [types.Call('a')])
def test_args(self): self.assertEqual(rules.Call.parse('a(b c d)'), types.Call('a', ['b', 'c', 'd']))
def test_two_char_no_parens(self): self.assertEqual(rules.Call.parse('ab'), types.Call('ab'))
def test_no_parens(self): self.assertEqual(rules.Call.parse('a'), types.Call('a'))
def test_two_deps(self): target = types.Target('a', directives=[types.Call('deps', ['b', 'c'])]) self.assertEqual(target.deps(), ['b', 'c'])
def test_both(self): self.check([types.Call('deps', ['a']), types.Call('b')], (['a'], [types.Call('b')]))
def test_just_deps(self): self.check([types.Call('deps', ['a'])], (['a'], []))