def setUp(self):
        BaseTestParticipantHandler.setUp(self)

        # Mock bugzilla interface without interfering with the real module
        import boss

        self.mockzilla = Mock(spec_set=boss.bz.base.BaseBugzilla)
        self.mut.BugzillaXMLRPC = Mock(return_value=self.mockzilla)
        self.mut.BugzillaREST = Mock(return_value=self.mockzilla)

        self.config = ConfigParser.SafeConfigParser()
        self.config.read("tests/test_data/bugzilla_right.conf")
        self.bugnum = "1234"
        self.changelog = (
            "* Wed Aug 10 2011 Dmitry Rozhkov <*****@*****.**> - 0.6.1\n- made changes fixing BMC#%s" % self.bugnum
        )

        self.bug_status = "RESOLVED"
        self.bug_resolution = "FIXED"
        self.expect_status = None
        self.expect_resolution = None
        self.expect_comment = None
        self.bug_get_calls = 0
        self.bug_update_calls = 0

        self.mockzilla.bug_get.side_effect = self.mock_bug_get
        self.mockzilla.bug_update.side_effect = self.mock_bug_update
 def setUp(self):
     """Set up the tests."""
     BaseTestParticipantHandler.setUp(self)
     os.mkdir(TEMP_DIR)
     config = ConfigParser()
     config.add_section("obs")
     config.set("obs", "oscrc", "oscrc_file")
     config.add_section("getbuildlog")
     config.set("getbuildlog", "logdir", "test_tmp")
     ctrl = Mock()
     ctrl.message = "start"
     ctrl.config = config
     self.participant.handle_lifecycle_control(ctrl)
 def setUp(self):  # pylint: disable=C0103
     """Test setup."""
     BaseTestParticipantHandler.setUp(self)
     ctrl = Mock()
     ctrl.message = "start"
     ctrl.config = ConfigParser()
     ctrl.config.add_section("obs")
     ctrl.config.add_section("defineimage")
     ctrl.config.add_section("testing")
     ctrl.config.set("obs", "oscrc", "oscrc_file")
     ctrl.config.set("defineimage", "imagetypes", "testing")
     ctrl.config.set("testing", "always_include", "base-tests")
     self.ctrl = ctrl
 def setUp(self): # pylint: disable=C0103
     """Test setup."""
     BaseTestParticipantHandler.setUp(self)
     ctrl = Mock()
     ctrl.message = "start"
     ctrl.config = ConfigParser()
     ctrl.config.add_section("obs")
     ctrl.config.add_section("defineimage")
     ctrl.config.add_section("testing")
     ctrl.config.set("obs", "oscrc", "oscrc_file")
     ctrl.config.set("defineimage", "imagetypes", "testing")
     ctrl.config.set("testing", "always_include", "base-tests")
     self.ctrl = ctrl
 def setUp(self):
     """Set up the tests."""
     BaseTestParticipantHandler.setUp(self)
     os.mkdir(TEMP_DIR)
     config = ConfigParser()
     config.add_section("obs")
     config.set("obs", "oscrc", "oscrc_file")
     config.add_section("getbuildlog")
     config.set("getbuildlog", "logdir", "test_tmp")
     ctrl = Mock()
     ctrl.message = "start"
     ctrl.config = config
     self.participant.handle_lifecycle_control(ctrl)
示例#6
0
    def setUp(self):
        BaseTestParticipantHandler.setUp(self)

        # Mock bugzilla interface without interfering with the real module
        import boss
        self.mockzilla = Mock(spec_set=boss.bz.base.BaseBugzilla)
        self.mut.BugzillaXMLRPC = Mock(return_value=self.mockzilla)
        self.mut.BugzillaREST = Mock(return_value=self.mockzilla)

        self.config = ConfigParser.SafeConfigParser()
        self.config.read("tests/test_data/bugzilla_right.conf")
        self.bugnum = "1234"
        self.changelog = "* Wed Aug 10 2011 Dmitry Rozhkov <*****@*****.**> - 0.6.1\n- made changes fixing BMC#%s" % self.bugnum

        self.bug_status = 'RESOLVED'
        self.bug_resolution = 'FIXED'
        self.expect_status = None
        self.expect_resolution = None
        self.expect_comment = None
        self.bug_get_calls = 0
        self.bug_update_calls = 0

        self.mockzilla.bug_get.side_effect = self.mock_bug_get
        self.mockzilla.bug_update.side_effect = self.mock_bug_update
 def setUp(self):
     BaseTestParticipantHandler.setUp(self)
     self.wid = Workitem(BASE_WORKITEM)
     self.participant.obs.getFile.return_value = TEST_SPEC
 def tearDown(self):
     """Tear down the tests."""
     BaseTestParticipantHandler.tearDown(self)
     shutil.rmtree(TEMP_DIR)
 def setUp(self):
     BaseTestParticipantHandler.setUp(self)
     self.wid = Workitem(BASE_WORKITEM)
     self.participant.obs.getFile.return_value = TEST_SPEC
 def tearDown(self):
     """Tear down the tests."""
     BaseTestParticipantHandler.tearDown(self)
     shutil.rmtree(TEMP_DIR)