コード例 #1
0
ファイル: test_rulecloth.py プロジェクト: tychoish/buildcloth
    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
        }
コード例 #2
0
ファイル: test_rulecloth.py プロジェクト: tychoish/buildcloth
    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 }
コード例 #3
0
ファイル: test_rulecloth.py プロジェクト: tychoish/buildcloth
    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
コード例 #4
0
ファイル: test_rulecloth.py プロジェクト: tychoish/buildcloth
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)
コード例 #5
0
ファイル: test_rulecloth.py プロジェクト: tychoish/buildcloth
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)
コード例 #6
0
ファイル: test_rulecloth.py プロジェクト: tychoish/buildcloth
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())
コード例 #7
0
ファイル: test_rulecloth.py プロジェクト: tychoish/buildcloth
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())
コード例 #8
0
ファイル: test_rulecloth.py プロジェクト: tychoish/buildcloth
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()
コード例 #9
0
ファイル: test_rulecloth.py プロジェクト: tychoish/buildcloth
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()
コード例 #10
0
ファイル: test_rulecloth.py プロジェクト: tychoish/buildcloth
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))
コード例 #11
0
ファイル: test_rulecloth.py プロジェクト: tychoish/buildcloth
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))
コード例 #12
0
ファイル: test_rulecloth.py プロジェクト: tychoish/buildcloth
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())
コード例 #13
0
ファイル: test_rulecloth.py プロジェクト: tychoish/buildcloth
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())
コード例 #14
0
ファイル: test_rulecloth.py プロジェクト: tychoish/buildcloth
 def setUp(self):
     self.r = Rule()
     self.command = ['cat foo | grep']
コード例 #15
0
ファイル: test_rulecloth.py プロジェクト: tychoish/buildcloth
 def setUp(self):
     self.r = Rule()
     self.depfile = 'output.d'
コード例 #16
0
ファイル: test_rulecloth.py プロジェクト: tychoish/buildcloth
 def setUp(self):
     self.r = Rule()
     self.command = ['cat foo | grep']
コード例 #17
0
ファイル: test_rulecloth.py プロジェクト: tychoish/buildcloth
 def setUp(self):
     self.r = Rule()
コード例 #18
0
ファイル: test_rulecloth.py プロジェクト: tychoish/buildcloth
 def setUp(self):
     self.r = Rule()
     self.name = 'rulenametest'
コード例 #19
0
ファイル: test_rulecloth.py プロジェクト: tychoish/buildcloth
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())
コード例 #20
0
ファイル: test_rulecloth.py プロジェクト: tychoish/buildcloth
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())
コード例 #21
0
ファイル: test_rulecloth.py プロジェクト: tychoish/buildcloth
 def setUp(self):
     self.r = Rule()
コード例 #22
0
ファイル: test_rulecloth.py プロジェクト: tychoish/buildcloth
 def setUp(self):
     self.r = Rule()
     self.name = 'rulenametest'
コード例 #23
0
ファイル: test_rulecloth.py プロジェクト: tychoish/buildcloth
 def setUp(self):
     self.r = Rule()
     self.depfile = 'output.d'
コード例 #24
0
ファイル: test_rulecloth.py プロジェクト: tychoish/buildcloth
 def setUp(self):
     self.r = Rule()
     self.description = 'this is message text'
コード例 #25
0
ファイル: test_rulecloth.py プロジェクト: tychoish/buildcloth
 def setUp(self):
     self.r = Rule()
     self.description = 'this is message text'