Ejemplo n.º 1
0
 def test_sourcestamp_081(self):
     # an empty pickled sourcestamp from 0.8.1
     pkl = textwrap.dedent("""\
             (ibuildbot.sourcestamp
             SourceStamp
             p1
             (dp2
             S'repository'
             p3
             S''
             sS'buildbot.sourcestamp.SourceStamp.persistenceVersion'
             p4
             I2
             sS'patch'
             p5
             NsS'project'
             p6
             S''
             sS'branch'
             p7
             NsS'revision'
             p8
             Nsb.""")
     ss = pickle.loads(pkl)
     self.assertTrue(ss.revision is None)
     self.assertTrue(hasattr(ss, 'codebase'))
Ejemplo n.º 2
0
 def pickle_and_restore(self):
     pkl = pickle.dumps(self.logfile)
     self.logfile = pickle.loads(pkl)
     step = self.build_step_status
     self.logfile.step = step
     self.logfile.master = self.master
     step.build.builder.basedir = self.basedir
Ejemplo n.º 3
0
 def test_sourcestamp_081(self):
     # an empty pickled sourcestamp from 0.8.1
     pkl = textwrap.dedent("""\
             (ibuildbot.sourcestamp
             SourceStamp
             p1
             (dp2
             S'repository'
             p3
             S''
             sS'buildbot.sourcestamp.SourceStamp.persistenceVersion'
             p4
             I2
             sS'patch'
             p5
             NsS'project'
             p6
             S''
             sS'branch'
             p7
             NsS'revision'
             p8
             Nsb.""")
     ss = pickle.loads(pkl)
     self.assertTrue(ss.revision is None)
     self.assertTrue(hasattr(ss, 'codebase'))
Ejemplo n.º 4
0
 def test_upgrade(self):
     self.patch(
         BuildStepStatus, "upgradeToVersion1", lambda _: self.fail("BuildStepStatus.upgradeToVersion1 called")
     )
     self.patch(BuildStatus, "upgradeToVersion1", lambda _: self.fail("BuildStatus.upgradeToVersion1 called"))
     self.patch(BuilderStatus, "upgradeToVersion1", lambda _: self.fail("BuilderStatus.upgradeToVersion1 called"))
     pkl_result = pickle.loads(self.pickle_data)
     styles.doUpgrade()
     del pkl_result
Ejemplo n.º 5
0
 def test_upgrade(self):
     self.patch(
         BuildStepStatus, 'upgradeToVersion1',
         lambda _: self.fail("BuildStepStatus.upgradeToVersion1 called"))
     self.patch(BuildStatus, 'upgradeToVersion1',
                lambda _: self.fail("BuildStatus.upgradeToVersion1 called"))
     self.patch(
         BuilderStatus, 'upgradeToVersion1',
         lambda _: self.fail("BuilderStatus.upgradeToVersion1 called"))
     pkl_result = pickle.loads(self.pickle_data)
     styles.doUpgrade()
     del pkl_result
Ejemplo n.º 6
0
 def test_sourcestamp_version3(self):
     pkl = textwrap.dedent("""\
         (ibuildbot.sourcestamp
         SourceStamp
         p1
         (dp2
         S'project'
         p3
         S''
         sS'repository'
         p4
         S''
         sS'patch_info'
         p5
         NsS'buildbot.sourcestamp.SourceStamp.persistenceVersion'
         p6
         I2
         sS'patch'
         Nsb.""")
     ss = pickle.loads(pkl)
     styles.doUpgrade()
     self.assertEqual(ss.codebase, '')
Ejemplo n.º 7
0
 def test_sourcestamp_version3(self):
     pkl = textwrap.dedent("""\
         (ibuildbot.sourcestamp
         SourceStamp
         p1
         (dp2
         S'project'
         p3
         S''
         sS'repository'
         p4
         S''
         sS'patch_info'
         p5
         NsS'buildbot.sourcestamp.SourceStamp.persistenceVersion'
         p6
         I2
         sS'patch'
         Nsb.""")
     ss = pickle.loads(pkl)
     styles.doUpgrade()
     self.assertEqual(ss.codebase, '')
Ejemplo n.º 8
0
 def test_sourcestamp(self):
     obj = pickle.loads(self.sourcestampPickle)
     self.assertIsInstance(obj, pickle.SourceStamp)
Ejemplo n.º 9
0
 def test_loads(self):
     obj = pickle.loads(self.simplePickle)
     self.assertSimplePickleContents(obj)