Пример #1
0
    def test_finder_ignores_files(self, mock_walk):
        mock_walk.return_value = [[".", [], ["file.txt", "keystone.conf", "keystone.domain0.conf"]]]

        domain_configs = list(cli._domain_config_finder("."))

        expected_domain_configs = [("./keystone.domain0.conf", "domain0")]
        self.assertThat(domain_configs, matchers.Equals(expected_domain_configs))

        expected_msg_template = "Ignoring file (%s) while scanning " "domain config directory"
        self.assertThat(self.logging.output, matchers.Contains(expected_msg_template % "file.txt"))
        self.assertThat(self.logging.output, matchers.Contains(expected_msg_template % "keystone.conf"))
Пример #2
0
    def test_finder_ignores_files(self, mock_walk):
        mock_walk.return_value = [
            ['.', [], ['file.txt', 'keystone.conf', 'keystone.domain0.conf']],
        ]

        domain_configs = list(cli._domain_config_finder('.'))

        expected_domain_configs = [('./keystone.domain0.conf', 'domain0')]
        self.assertThat(domain_configs,
                        matchers.Equals(expected_domain_configs))

        expected_msg_template = ('Ignoring file (%s) while scanning '
                                 'domain config directory')
        self.assertThat(self.logging.output,
                        matchers.Contains(expected_msg_template % 'file.txt'))
        self.assertThat(
            self.logging.output,
            matchers.Contains(expected_msg_template % 'keystone.conf'))
Пример #3
0
    def test_finder_ignores_files(self, mock_walk):
        mock_walk.return_value = [
            ['.', [], ['file.txt', 'keystone.conf', 'keystone.domain0.conf']],
        ]

        domain_configs = list(cli._domain_config_finder('.'))

        expected_domain_configs = [('./keystone.domain0.conf', 'domain0')]
        self.assertThat(domain_configs,
                        matchers.Equals(expected_domain_configs))

        expected_msg_template = ('Ignoring file (%s) while scanning '
                                 'domain config directory')
        self.assertThat(
            self.logging.output,
            matchers.Contains(expected_msg_template % 'file.txt'))
        self.assertThat(
            self.logging.output,
            matchers.Contains(expected_msg_template % 'keystone.conf'))