@@ -0,0 +1,1314 @@
+# Copyright 2014 Dan Kilman%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may obtain a copy of the License at%0A#%0A# http://www.apache.org/licenses/LICENSE-2.0%0A#%0A# Unless required by applicable law or agreed to in writing, software%0A# distributed under the License is distributed on an %22AS IS%22 BASIS,%0A# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A# See the License for the specific language governing permissions and%0A# limitations under the License.%0A%0A%0Afrom base import WithDaemonTestCase%0Afrom pysource.tests import command%0A%0A%0Aclass GlobalEnvTest(WithDaemonTestCase):%0A%0A    def test_global_env_emtpy(self):%0A        output = self.run_pysource_script(%5B%0A            command.source_def('''function1():%0A    return %22,%22.join(globals().keys())'''),%0A            command.run('function1')%0A        %5D).split(',')%0A        self.assertEqual(len(output), 8)%0A        self.assertIn('function1', output)%0A        self.assertIn('pysource', output)%0A        self.assertIn('__pysource_evaluate__', output)%0A        self.assertIn('__builtins__', output)%0A        self.assertIn('__file__', output)%0A        self.assertIn('__package__', output)%0A        self.assertIn('__name__', output)%0A        self.assertIn('__doc__', output)%0A

add test to ensure global_env is initially mostly empty