Example #1
0
	def test_virtualenv(self):
		pl = Pl()
		with replace_env('VIRTUAL_ENV', '/abc/def/ghi') as segment_info:
			self.assertEqual(common.virtualenv(pl=pl, segment_info=segment_info), 'ghi')
			segment_info['environ'].pop('VIRTUAL_ENV')
			self.assertEqual(common.virtualenv(pl=pl, segment_info=segment_info), None)
Example #2
0
	def test_virtualenv(self):
		with replace_env('VIRTUAL_ENV', '/abc/def/ghi'):
			self.assertEqual(common.virtualenv(), 'ghi')
			os.environ.pop('VIRTUAL_ENV')
			self.assertEqual(common.virtualenv(), None)