Ejemplo n.º 1
0
    def test_should_return_by_change_set_affected_hosts(self):

        service = SvnService(self.repo_url,
                             None,
                             None,
                             path_to_config=get_svn_path_to_config())

        self.assertEqual(['berweb01', 'devweb00', 'devweb01', 'tuvweb01'],
                         service.get_hosts(2))
    def test_should_ensure_that_all_returned_host_names_are_ordinary_strings(self):

        mock_svn_service = Mock(SvnService)
        mock_svn_service.config_url = '/path to repository/config'
        mock_svn_service.client = Mock()
        item0 = Mock()
        item0.repos_path = "get_hosts removes the first element - so this will never show up"
        item1 = Mock()
        item1.repos_path = "bar"
        item2 = Mock()
        item2.repos_path = u"spam"
        mock_svn_service.client.list.return_value = [(item0,), (item1,), (item2,)]

        actual_host_names = SvnService.get_hosts(mock_svn_service, 123)

        self.assert_is_ordinary_string(actual_host_names[0])
        self.assert_is_ordinary_string(actual_host_names[1])
    def test_should_return_by_change_set_affected_hosts(self):

        service = SvnService(self.repo_url, None, None, path_to_config=get_svn_path_to_config())

        self.assertEqual(['berweb01', 'devweb00', 'devweb01', 'tuvweb01'], service.get_hosts(2))