コード例 #1
0
    def test_lambda_with_globals(self):
        """Tests that the globals of a function are preserved."""

        # The point of the test is that the lambda being called after unpickling
        # relies on having the re module being loaded.
        self.assertEquals(
            ['abc', 'def'],
            loads(dumps(module_test.get_lambda_with_globals()))('abc def'))
コード例 #2
0
ファイル: pickler_test.py プロジェクト: aaltay/incubator-beam
  def test_lambda_with_globals(self):
    """Tests that the globals of a function are preserved."""

    # The point of the test is that the lambda being called after unpickling
    # relies on having the re module being loaded.
    self.assertEquals(
        ['abc', 'def'],
        loads(dumps(module_test.get_lambda_with_globals()))('abc def'))