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)
示例#3
0
 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)
示例#4
0
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
示例#5
0
 def testCatchesMultipleLeakedMocks(self):
     self.assertNotEqual(
         0,
         gmock_test_utils.Subprocess(TEST_MULTIPLE_LEAKS +
                                     ['--gmock_catch_leaked_mocks'],
                                     env=environ).exit_code)
示例#6
0
 def testCatchesLeakedMockWhenEnabledWithExplictFlagValue(self):
     self.assertNotEqual(
         0,
         gmock_test_utils.Subprocess(TEST_WITH_EXPECT_CALL +
                                     ['--gmock_catch_leaked_mocks=1'],
                                     env=environ).exit_code)