Example #1
0
    def test_upgrade_with_plugin(self):
        plugin_name = 'some-plugin'

        Helm2Client(provider=self.dummy_provider).upgrade([],
                                                          install=True,
                                                          plugin=plugin_name)
        self.dummy_provider.execute.assert_called_once()

        self.assertEqual(self.dummy_provider.execute.call_args[0][0].command,
                         plugin_name)
        self.assertEqual(self.dummy_provider.execute.call_args[0][0].arguments,
                         ["upgrade", "--install"])

        self.dummy_provider.reset_mock()

        Helm2Client(provider=self.dummy_provider).upgrade([],
                                                          install=False,
                                                          plugin=plugin_name)
        self.dummy_provider.execute.assert_called_once()

        self.assertEqual(self.dummy_provider.execute.call_args[0][0].command,
                         plugin_name)
        self.assertEqual(self.dummy_provider.execute.call_args[0][0].arguments,
                         ["upgrade"])
Example #2
0
 def test_version(self):
     self.dummy_provider.execute.return_value = HelmCmdResponse(
         0, '', 'Client: v0.0.0+gabcdef01234', '')
     assert '0.0.0' == Helm2Client(provider=self.dummy_provider).version
Example #3
0
    def test_get_cache(self):

        self.dummy_provider.execute.return_value = HelmCmdResponse(
            0, '', '/Users/test/.helm', '')
        assert "/Users/test/.helm" == Helm2Client(
            provider=self.dummy_provider).cache
Example #4
0
 def test_default_helm_arguments(self):
     helm_client = Helm2Client(provider=self.dummy_provider)
     assert hasattr(helm_client, 'default_helm_arguments')
Example #5
0
 def test_rollback(self):
     with self.assertRaises(NotImplementedError):
         Helm2Client(provider=self.dummy_provider).rollback('broken')
Example #6
0
 def test_repo_add(self):
     Helm2Client(provider=self.dummy_provider).repo_add('new', 'url')
     self.dummy_provider.execute.assert_called_once
Example #7
0
 def test_repo_update(self):
     Helm2Client(provider=self.dummy_provider).repo_update()
     self.dummy_provider.execute.assert_called_once
Example #8
0
 def test_dependency_update(self):
     Helm2Client(
         provider=self.dummy_provider).dependency_update('chart_path')
     self.dummy_provider.execute.assert_called_once