def setUp(self): self.r = Rule() self.name = 'rulenametest' self.description = 'this is message text' self.command = ['cat foo | grep'] self.depfile = 'output.d' self.example_rule = { 'name': self.name, 'description': self.description, 'command': self.command, 'depfile': self.depfile }
def setUp(self): self.r = Rule() self.name = 'rulenametest' self.description = 'this is message text' self.command = ['cat foo | grep'] self.depfile = 'output.d' self.example_rule = { 'name' : self.name, 'description': self.description, 'command': self.command, 'depfile': self.depfile }
def setUp(self): self.rdb = RuleCloth() self.rule_name = 'ccompile' self.example_rule = { 'name': self.rule_name, 'description': 'compile $file', 'command': ['cc $in'] } self.rule_obj = Rule(self.rule_name) self.rule_obj._rule = self.example_rule
class TestRuleCommand(TestCase): @classmethod def setUp(self): self.r = Rule() self.command = ['cat foo | grep'] def test_command_helper(self): self.r.command(self.command) self.assertEqual(self.command, self.r._rule['command']) def test_default_command_state(self): self.assertEqual(self.r.command(), None) def test_cmd_command_alias(self): self.assertEqual(self.r.cmd, self.r.command) def test_command_return_value(self): self.assertTrue(self.r.command(self.command)) def test_command_string(self): cmd = 'a string' self.assertEqual(self.r.command(cmd), cmd)
class TestRuleCommand(TestCase): @classmethod def setUp(self): self.r = Rule() self.command = ['cat foo | grep'] def test_command_helper(self): self.r.command(self.command) self.assertEqual(self.command , self.r._rule['command']) def test_default_command_state(self): self.assertEqual(self.r.command(), None) def test_cmd_command_alias(self): self.assertEqual(self.r.cmd, self.r.command) def test_command_return_value(self): self.assertTrue(self.r.command(self.command)) def test_command_string(self): cmd = 'a string' self.assertEqual(self.r.command(cmd), cmd)
class TestRuleDepFile(TestCase): @classmethod def setUp(self): self.r = Rule() self.depfile = 'output.d' def test_depfile_return_value(self): self.assertTrue(self.r.depfile(self.depfile)) def test_depfile_helper(self): self.r.depfile(self.depfile) self.assertEqual(self.depfile, self.r._rule['depfile']) def test_default_depfile_state(self): with self.assertRaises(KeyError): self.r.depfile() def test_depfile_return_helper(self): self.r.depfile(self.depfile) self.assertEqual(self.depfile, self.r.depfile())
class TestRuleDepFile(TestCase): @classmethod def setUp(self): self.r = Rule() self.depfile = 'output.d' def test_depfile_return_value(self): self.assertTrue(self.r.depfile(self.depfile)) def test_depfile_helper(self): self.r.depfile(self.depfile) self.assertEqual(self.depfile , self.r._rule['depfile']) def test_default_depfile_state(self): with self.assertRaises(KeyError): self.r.depfile() def test_depfile_return_helper(self): self.r.depfile(self.depfile) self.assertEqual(self.depfile , self.r.depfile())
class TestRuleRestat(TestCase): @classmethod def setUp(self): self.r = Rule() def test_restat_return_value(self): self.assertTrue(self.r.restat()) def test_restat_exists(self): self.r.restat() self.assertTrue(self.r.restat()) def test_rule_without_name(self): with self.assertRaises(InvalidRule): self.r.rule()
class TestRuleName(TestCase): @classmethod def setUp(self): self.r = Rule() self.name = 'rulenametest' def test_default_name(self): self.assertEqual(self.r._rule['name'], None) def test_name_requirement(self): with self.assertRaises(InvalidRule): self.r.name() def test_add_name_helper(self): self.r.name(self.name) self.assertEqual(self.name, self.r._rule['name']) def test_return_name_helper(self): self.r.name(self.name) self.assertEqual(self.r.name(), self.name) def test_name_return_value(self): self.assertTrue(self.r.name(self.name))
class TestRuleDescription(TestCase): @classmethod def setUp(self): self.r = Rule() self.description = 'this is message text' def test_description_return_value(self): self.assertTrue(self.r.description(self.description)) def test_msg_description_alias(self): self.assertEqual(self.r.msg, self.r.description) def test_description_helper(self): self.r.description(self.description) self.assertEqual(self.description , self.r._rule['description']) def test_description_return_helper(self): self.r.description(self.description) self.assertEqual(self.description , self.r.description())
class TestRuleDescription(TestCase): @classmethod def setUp(self): self.r = Rule() self.description = 'this is message text' def test_description_return_value(self): self.assertTrue(self.r.description(self.description)) def test_msg_description_alias(self): self.assertEqual(self.r.msg, self.r.description) def test_description_helper(self): self.r.description(self.description) self.assertEqual(self.description, self.r._rule['description']) def test_description_return_helper(self): self.r.description(self.description) self.assertEqual(self.description, self.r.description())
def setUp(self): self.r = Rule() self.command = ['cat foo | grep']
def setUp(self): self.r = Rule() self.depfile = 'output.d'
def setUp(self): self.r = Rule()
def setUp(self): self.r = Rule() self.name = 'rulenametest'
class TestRule(TestCase): @classmethod def setUp(self): self.r = Rule() self.name = 'rulenametest' self.description = 'this is message text' self.command = ['cat foo | grep'] self.depfile = 'output.d' self.example_rule = { 'name' : self.name, 'description': self.description, 'command': self.command, 'depfile': self.depfile } def test_rule_return(self): self.r.name(self.name) self.r.description(self.description) self.r.command(self.command) rule = self.r.rule() self.assertEqual(type(rule), type(self.example_rule)) def test_rule_has_keys(self): self.r.name(self.name) self.r.description(self.description) self.r.command(self.command) self.r.depfile(self.depfile) rule = self.r.rule() self.assertEqual(rule.keys(), self.example_rule.keys())
class TestRule(TestCase): @classmethod def setUp(self): self.r = Rule() self.name = 'rulenametest' self.description = 'this is message text' self.command = ['cat foo | grep'] self.depfile = 'output.d' self.example_rule = { 'name': self.name, 'description': self.description, 'command': self.command, 'depfile': self.depfile } def test_rule_return(self): self.r.name(self.name) self.r.description(self.description) self.r.command(self.command) rule = self.r.rule() self.assertEqual(type(rule), type(self.example_rule)) def test_rule_has_keys(self): self.r.name(self.name) self.r.description(self.description) self.r.command(self.command) self.r.depfile(self.depfile) rule = self.r.rule() self.assertEqual(rule.keys(), self.example_rule.keys())
def setUp(self): self.r = Rule() self.description = 'this is message text'