コード例 #1
0
 def test_happy(self):
     fake_base = os.path.abspath(os.path.join('pretends_to_exist'))
     fake_name = 'also_pretend'
     fake_path = os.path.join(fake_base, fake_name)
     fake_exists = make_fake_exists([fake_base, fake_path])
     with patch('os.path.exists', wraps=fake_exists):
         path = main.get_virtualenv_path(fake_base, fake_name)
         assert path == fake_path
コード例 #2
0
ファイル: test_main.py プロジェクト: cwacek/vex
 def test_happy(self):
     fake_base = os.path.abspath(os.path.join('pretends_to_exist'))
     fake_name = 'also_pretend'
     fake_path = os.path.join(fake_base, fake_name)
     fake_exists = make_fake_exists([fake_base, fake_path])
     with patch('os.path.exists', wraps=fake_exists):
         path = main.get_virtualenv_path(fake_base, fake_name)
         assert path == fake_path
コード例 #3
0
ファイル: test_main.py プロジェクト: cwacek/vex
 def test_nonexistent_ve_path(self):
     fake_path = os.path.abspath(os.path.join('pretends_to_exist'))
     fake_exists = make_fake_exists([fake_path])
     with patch('os.path.exists', wraps=fake_exists), \
       raises(exceptions.InvalidVirtualenv):
         main.get_virtualenv_path(fake_path, "/unlikely_to_exist2")
コード例 #4
0
ファイル: test_main.py プロジェクト: cwacek/vex
 def test_nonexistent_ve_base(self):
     with raises(exceptions.NoVirtualenvsDirectory):
         main.get_virtualenv_path("/unlikely_to_exist1", "anything")
コード例 #5
0
ファイル: test_main.py プロジェクト: cwacek/vex
 def test_no_ve_base(self):
     with raises(exceptions.NoVirtualenvsDirectory):
         main.get_virtualenv_path("", "anything")
コード例 #6
0
 def test_nonexistent_ve_path(self):
     fake_path = os.path.abspath(os.path.join('pretends_to_exist'))
     fake_exists = make_fake_exists([fake_path])
     with patch('os.path.exists', wraps=fake_exists), \
       raises(exceptions.InvalidVirtualenv):
         main.get_virtualenv_path(fake_path, "/unlikely_to_exist2")
コード例 #7
0
 def test_nonexistent_ve_base(self):
     with raises(exceptions.NoVirtualenvsDirectory):
         main.get_virtualenv_path("/unlikely_to_exist1", "anything")
コード例 #8
0
 def test_no_ve_base(self):
     with raises(exceptions.NoVirtualenvsDirectory):
         main.get_virtualenv_path("", "anything")
コード例 #9
0
 def test_no_ve_name(self):
     fake_path = os.path.abspath(os.path.join("pretends_to_exist"))
     fake_exists = make_fake_exists([fake_path])
     with patch("os.path.exists", wraps=fake_exists), \
       raises(exceptions.InvalidVirtualenv):
         main.get_virtualenv_path(fake_path, "")