示例#1
0
 def test_WORKON_HOME_is_unset_user_home_dot_virtualenvs_is_returned(self):
     def expanduser(arg):
         self.assertEqual('~', arg)
         return '/test/user/home'
     patch_expanduser = mock.patch('os.path.expanduser', expanduser)
     patch_environ = mock.patch('os.environ', {})
     with patch_expanduser, patch_environ:
         self.assertEqual(
             '/test/user/home/.virtualenvs',
             m.get_virtualenv_parent_dir())
示例#2
0
    def test_defaults(self):
        args = m.parse_args(['dir/scriptname.py'])

        self.assertEqual(working_directory().path, args.datastore)

        self.assertEqual(
            m.TEMPORARY_DIRECTORY,
            args.script_working_directory)

        self.assertEqual(
            m.get_virtualenv_parent_dir(),
            args.virtualenv_parent_directory)
示例#3
0
 def test_value_of_WORKON_HOME_is_returned(self):
     environ = {'WORKON_HOME': '/virtualenvs'}
     with mock.patch('os.environ', environ):
         self.assertEqual('/virtualenvs', m.get_virtualenv_parent_dir())