コード例 #1
0
ファイル: recipe.py プロジェクト: kroman0/bitten
 def test_run_wrong_arg(self):
     ctxt = Context(self.basedir)
     try:
         ctxt.run(1, 'http://bitten.edgewall.org/tools/sh', 'exec', {'foo':'bar'})
         self.fail("InvalidRecipeError expected")
     except InvalidRecipeError, e:
         self.failUnless("Unsupported argument 'foo'" in str(e))
コード例 #2
0
ファイル: pythontools.py プロジェクト: pombredanne/trachacks
 def setUp(self):
     self.basedir = os.path.realpath(tempfile.mkdtemp())
     self.ctxt = Context(self.basedir)
     self.summary = open(os.path.join(self.basedir, 'test-coverage.txt'),
                         'w')
     self.coverdir = os.path.join(self.basedir, 'coverage')
     os.mkdir(self.coverdir)
コード例 #3
0
ファイル: recipe.py プロジェクト: kroman0/bitten
    def test_vars_basedir(self):
        config = Configuration(properties={'foo.bar': 'baz'})
        ctxt = Context('%s/${path}/${foo.bar}' % os.path.realpath('/foo'),
                        config, {'path': 'bar'})

        self.assertEquals(os.path.realpath('/foo/bar/baz'),
                        os.path.realpath(ctxt.vars['basedir']))
        if os.name == 'nt':
            # Make sure paths are double-escaped
            self.failUnless('\\\\' in ctxt.vars['basedir'])
コード例 #4
0
    def test_attach_file_non_existing(self):
        # Verify that it raises error and that it gets logged
        ctxt = Context(self.basedir, Configuration())
        ctxt.attach(file_='nonexisting.txt',
                      description='build build')

        self.assertEquals(1, len(ctxt.output))
        self.assertEquals(Recipe.ERROR, ctxt.output[0][0])
        self.assertEquals('Failed to read file nonexisting.txt as attachment',
                            ctxt.output[0][3])
コード例 #5
0
ファイル: recipe.py プロジェクト: kroman0/bitten
    def test_attach_file_build(self):
        # Verify output from attaching a file to a build
        ctxt = Context(self.basedir, Configuration())

        ctxt.attach(file_='build.txt', description='build build')
        self.assertEquals(1, len(ctxt.output))
        self.assertEquals(Recipe.ATTACH, ctxt.output[0][0])
        attach_xml = ctxt.output[0][3]
        self.assertEquals('<file resource="build" '
                          'description="build build" '
                          'filename="build.txt"/>', str(attach_xml))
コード例 #6
0
    def test_attach_file_build(self):
        # Verify output from attaching a file to a build
        ctxt = Context(self.basedir, Configuration())
        test_file = open(os.path.join(self.basedir, 'build.txt'), 'w')
        test_file.write('hello build')
        test_file.close()

        ctxt.attach(file_='build.txt', description='build build')
        self.assertEquals(1, len(ctxt.output))
        self.assertEquals(Recipe.ATTACH, ctxt.output[0][0])
        attach_xml = ctxt.output[0][3]
        self.assertEquals('<file resource="build" '
                          'description="build build" '
                          'filename="build.txt">'
                          'aGVsbG8gYnVpbGQ=\n'
                          '</file>', str(attach_xml))
コード例 #7
0
    def test_attach_file_config(self):
        # Verify output from attaching a file to a config
        ctxt = Context(self.basedir, Configuration())
        test_file = open(os.path.join(self.basedir, 'config.txt'), 'w')
        test_file.write('hello config')
        test_file.close()

        ctxt.attach(file_='config.txt', description='config config',
                      resource='config')
        self.assertEquals(1, len(ctxt.output))
        self.assertEquals(Recipe.ATTACH, ctxt.output[0][0])
        attach_xml = ctxt.output[0][3]
        self.assertEquals('<file resource="config" '
                          'description="config config" '
                          'filename="config.txt">'
                          'aGVsbG8gY29uZmln\n'
                          '</file>', str(attach_xml))
コード例 #8
0
ファイル: javatools.py プロジェクト: hefloryd/bitten
 def setUp(self):
     self.basedir = os.path.realpath(tempfile.mkdtemp())
     self.ctxt = Context(self.basedir)
コード例 #9
0
ファイル: pythontools.py プロジェクト: pombredanne/trachacks
 def setUp(self):
     self.basedir = os.path.realpath(tempfile.mkdtemp())
     self.ctxt = Context(self.basedir)
     self.results_xml = open(os.path.join(self.basedir, 'test-results.xml'),
                             'w')
コード例 #10
0
ファイル: pythontools.py プロジェクト: pombredanne/trachacks
 def setUp(self):
     self.basedir = os.path.realpath(tempfile.mkdtemp())
     self.ctxt = Context(self.basedir)
     self.summary = open(os.path.join(self.basedir, '.figleaf'), 'w')