def test_trycmd(self):
        config = dict(jobdir="jobdir")
        inputfile = StringIO("this is my try job")
        self.patch(sys, "stdin", inputfile)

        rc = tryserver.tryserver(config)

        self.assertEqual(rc, 0)

        newfiles = os.listdir(self.newdir)
        tmpfiles = os.listdir(self.tmpdir)
        self.assertEqual((len(newfiles), len(tmpfiles)), (1, 0))
        with open(os.path.join(self.newdir, newfiles[0]), "rt") as f:
            self.assertEqual(f.read(), "this is my try job")
Ejemplo n.º 2
0
    def test_trycmd(self):
        config = dict(jobdir='jobdir')
        inputfile = StringIO('this is my try job')
        self.patch(sys, 'stdin', inputfile)

        rc = tryserver.tryserver(config)

        self.assertEqual(rc, 0)

        newfiles = os.listdir(self.newdir)
        tmpfiles = os.listdir(self.tmpdir)
        self.assertEqual((len(newfiles), len(tmpfiles)), (1, 0))
        with open(os.path.join(self.newdir, newfiles[0]), 'rt') as f:
            self.assertEqual(f.read(), 'this is my try job')
Ejemplo n.º 3
0
    def test_trycmd(self):
        config = dict(jobdir='jobdir')
        inputfile = NativeStringIO('this is my try job')
        self.patch(sys, 'stdin', inputfile)

        rc = tryserver.tryserver(config)

        self.assertEqual(rc, 0)

        newfiles = os.listdir(self.newdir)
        tmpfiles = os.listdir(self.tmpdir)
        self.assertEqual((len(newfiles), len(tmpfiles)),
                         (1, 0))
        with open(os.path.join(self.newdir, newfiles[0]), 'rt') as f:
            self.assertEqual(f.read(), 'this is my try job')