Esempio n. 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
Esempio n. 2
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
Esempio n. 3
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")
Esempio n. 4
0
 def test_nonexistent_ve_base(self):
     with raises(exceptions.NoVirtualenvsDirectory):
         main.get_virtualenv_path("/unlikely_to_exist1", "anything")
Esempio n. 5
0
 def test_no_ve_base(self):
     with raises(exceptions.NoVirtualenvsDirectory):
         main.get_virtualenv_path("", "anything")
Esempio n. 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")
Esempio n. 7
0
 def test_nonexistent_ve_base(self):
     with raises(exceptions.NoVirtualenvsDirectory):
         main.get_virtualenv_path("/unlikely_to_exist1", "anything")
Esempio n. 8
0
 def test_no_ve_base(self):
     with raises(exceptions.NoVirtualenvsDirectory):
         main.get_virtualenv_path("", "anything")
Esempio n. 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, "")