Exemplo n.º 1
0
 def test_tgz_repository(self):
     self.configure_subprocess_mock('', '', 0)
     r = Repository(test_repository_dict)
     self.assertIsInstance(r, Repository)
     self.assertEqual(r.name, test_repository_dict['name'])
     self.assertEqual(r.url, test_repository_dict['url'])
     self.assertEqual(r.install("test_chart"), Response('', '', 0))
Exemplo n.º 2
0
 def test_git_repository(self):
     self.configure_subprocess_mock('', '', 0)
     r = Repository(test_git_repository)
     self.assertIsInstance(r, Repository)
     self.assertEqual(r.git, test_git_repository['git'])
     self.assertEqual(r.path, test_git_repository['path'])
     self.assertEqual(r.install("test_chart"), None)
Exemplo n.º 3
0
 def test_tgz_repository(self):
     helm_mock = mock.Mock()
     helm_mock.repositories = []
     r = Repository(test_repository_dict, helm_mock)
     self.assertIsInstance(r, Repository)
     self.assertEqual(r.name, test_repository_dict['name'])
     self.assertEqual(r.url, test_repository_dict['url'])
     assert r.install("test_chart")
Exemplo n.º 4
0
 def test_git_repository(self, mock_git_lib):
     helm_mock = mock.Mock()
     helm_mock.repositories = []
     r = Repository(test_git_repository, helm_mock)
     self.assertIsInstance(r, Repository)
     self.assertEqual(r.git, test_git_repository['git'])
     self.assertEqual(r.path, test_git_repository['path'])
     self.assertEqual(r.install("test_chart"), None)
Exemplo n.º 5
0
 def test_add_repo_for_remote_chart(self, helm_client):
     repo = Repository(dict(name='testrepo', url='url'), helm_client)
     repo.install('test_chart')
     helm_client.repo_add.assert_called()
Exemplo n.º 6
0
 def test_do_not_add_repo_for_git_chart(self, helm_client):
     with patch('reckoner.repository.Repository._fetch_from_git'):
         repo = Repository(dict(name='testrepo', git='../'), helm_client)
         repo.install('test_chart')
         helm_client.repo_add.assert_not_called()
Exemplo n.º 7
0
 def test_do_not_add_repo_for_local_chart(self, helm_client):
     repo = Repository(dict(name='testrepo', path='../'), helm_client)
     repo.install('test_chart')
     helm_client.repo_add.assert_not_called()