def testCatchesLeakedMockByDefault(self): self.assertNotEqual( 0, gmock_test_utils.Subprocess(TEST_WITH_EXPECT_CALL).exit_code) self.assertNotEqual( 0, gmock_test_utils.Subprocess(TEST_WITH_ON_CALL).exit_code)
def testCatchesLeakedMockWhenEnabled(self): self.assertNotEqual( 0, gmock_test_utils.Subprocess( TEST_WITH_EXPECT_CALL + ['--gmock_catch_leaked_mocks']).exit_code) self.assertNotEqual( 0, gmock_test_utils.Subprocess( TEST_WITH_ON_CALL + ['--gmock_catch_leaked_mocks']).exit_code)
def testDoesNotCatchLeakedMockWhenDisabled(self): self.assertEquals( 0, gmock_test_utils.Subprocess(TEST_WITH_EXPECT_CALL + ['--gmock_catch_leaked_mocks=0'], env=environ).exit_code) self.assertEquals( 0, gmock_test_utils.Subprocess(TEST_WITH_ON_CALL + ['--gmock_catch_leaked_mocks=0'], env=environ).exit_code)
def GetShellCommandOutput(cmd): """Runs a command in a sub-process, and returns its STDOUT in a string.""" return gmock_test_utils.Subprocess(cmd, capture_stderr=False).output
def testCatchesMultipleLeakedMocks(self): self.assertNotEqual( 0, gmock_test_utils.Subprocess(TEST_MULTIPLE_LEAKS + ['--gmock_catch_leaked_mocks'], env=environ).exit_code)
def testCatchesLeakedMockWhenEnabledWithExplictFlagValue(self): self.assertNotEqual( 0, gmock_test_utils.Subprocess(TEST_WITH_EXPECT_CALL + ['--gmock_catch_leaked_mocks=1'], env=environ).exit_code)