Ejemplo n.º 1
0
 def test_netrc_success(self, MockOsPath):
   with patch('pants.util.netrc.NetrcDb') as mock_netrc:
     instance = mock_netrc.return_value
     instance.hosts = {'host': ('user', 'user', 'passw0rd')}
     instance.authenticators.return_value = ('user', 'user', 'passw0rd')
     netrc = Netrc()
     netrc._ensure_loaded()
Ejemplo n.º 2
0
 def test_netrc_success(self, MockOsPath):
     with patch('pants.util.netrc.NetrcDb') as mock_netrc:
         instance = mock_netrc.return_value
         instance.hosts = {'host': ('user', 'user', 'passw0rd')}
         instance.authenticators.return_value = ('user', 'user', 'passw0rd')
         netrc = Netrc()
         netrc._ensure_loaded()
Ejemplo n.º 3
0
 def test_netrc_file_missing_error(self, MockOsPath):
     MockOsPath.exists.return_value = False
     netrc = Netrc()
     with self.assertRaises(netrc.NetrcError) as exc:
         netrc._ensure_loaded()
     assert str(
         exc.exception) == 'A ~/.netrc file is required to authenticate'
Ejemplo n.º 4
0
 def test_netrc_success(self, MockOsPath):
     with patch("pants.util.netrc.NetrcDb") as mock_netrc:
         instance = mock_netrc.return_value
         instance.hosts = {"host": ("user", "user", "passw0rd")}
         instance.authenticators.return_value = ("user", "user", "passw0rd")
         netrc = Netrc()
         netrc._ensure_loaded()
Ejemplo n.º 5
0
 def test_netrc_file_missing_error(self, MockOsPath):
   MockOsPath.exists.return_value = False
   netrc = Netrc()
   with self.assertRaises(netrc.NetrcError) as exc:
     netrc._ensure_loaded()
   assert str(exc.exception) == 'A ~/.netrc file is required to authenticate'