def test_should_load_configuration_file_when_no_properties_available(self, mock_load_configuration_file, mock_properties):

        mock_properties.return_value = None

        def mock_set_properties():
            mock_properties.return_value = {self.mock_configuration_property: 12345}

        mock_load_configuration_file.side_effect = mock_set_properties

        ConfigurationProperty.__call__(self.mock_configuration_property)

        mock_load_configuration_file.assert_called_with()
예제 #2
0
    def test_should_load_configuration_file_when_no_properties_available(
            self, mock_load_configuration_file, mock_properties):

        mock_properties.return_value = None

        def mock_set_properties():
            mock_properties.return_value = {
                self.mock_configuration_property: 12345
            }

        mock_load_configuration_file.side_effect = mock_set_properties

        ConfigurationProperty.__call__(self.mock_configuration_property)

        mock_load_configuration_file.assert_called_with()
    def test_should_return_value_of_property_when_in_properties(self, mock_properties):

        mock_properties.return_value = {self.mock_configuration_property: 28374}

        actual = ConfigurationProperty.__call__(self.mock_configuration_property)

        self.assertEqual(28374, actual)
예제 #4
0
    def test_should_return_value_of_property_when_in_properties(
            self, mock_properties):

        mock_properties.return_value = {
            self.mock_configuration_property: 28374
        }

        actual = ConfigurationProperty.__call__(
            self.mock_configuration_property)

        self.assertEqual(28374, actual)