Example #1
0
 def test_enable_enabled_repo(self, mock_binding, *unused):
     # Test
     command = commands.NodeRepoEnableCommand(self.context)
     keywords = {
         commands.OPTION_REPO_ID.keyword: REPOSITORY_ID,
         commands.AUTO_PUBLISH_OPTION.keyword: 'true',
     }
     command.run(**keywords)
     # Verify
     self.assertTrue(commands.OPTION_REPO_ID in command.options)
     self.assertTrue(commands.AUTO_PUBLISH_OPTION in command.options)
     self.assertFalse(mock_binding.called)
Example #2
0
 def test_enable_no_auto_publish(self, mock_binding, *unused):
     # Test
     command = commands.NodeRepoEnableCommand(self.context)
     keywords = {
         commands.OPTION_REPO_ID.keyword: REPOSITORY_ID,
         commands.AUTO_PUBLISH_OPTION.keyword: 'false',
     }
     command.run(**keywords)
     # Verify
     self.assertTrue(commands.OPTION_REPO_ID in command.options)
     self.assertTrue(commands.AUTO_PUBLISH_OPTION in command.options)
     mock_binding.assert_called_with(REPOSITORY_ID,
                                     constants.HTTP_DISTRIBUTOR, {}, False,
                                     constants.HTTP_DISTRIBUTOR)