krystosan 0 Junior Poster

I want to test the layer filtering feature that I added in the UI, so

to test using mox

 def test_layerFilter(self):
    """    layer filter Knob changed
    """
    mx = mox.Mox()
    mx.StubOutWithMock(self.writeTab, '_createElementTypesFilterList')
    mx.StubOutWithMock(self.writeTab, 'getDetails')
    mx.StubOutWithMock(self.writeTab, 'updateResolutions')
    self.writeTab.updateResolutions()

    # Calls
    self.writeTab._createElementTypesFilterList().AndReturn(['I', 'IST',])
    self.writeTab.getDetails().AndReturn(['I_bar'])

    mx.ReplayAll()
    self.writeTab.refresh('layerFilter')
    self.assertEquals(self.writeNode['layerOption'].values(), ['I_bar'])

    mx.verifyMox()

my test assertion passes, but when I the mx.VerifyMox is executed I get error saying ExpectedMockCreationError: Expected...onError()

any help will be much appreciated, I want to strengthen my hand on testing using python mox testing by google I would appreciate if you can point the mistake I've made..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.