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