def test002_test_stub_in_sinontest(self): base = SinonStub() self.assertEqual(len(base._queue), 1) TestSinonSandbox._stub_in_sinontest() self.assertEqual(len(base._queue), 1) base.restore()
def test204_constructor_empty_library_function(self): self.assertEqual(os.system("cd"), 0) stub = SinonStub(os, "system", TestSinonStub.my_func) self.assertEqual(os.system("cd"), "my_func") stub.restore() self.assertEqual(os.system("cd"), 0)