Example #1
0
def load_rest_api_config(first_config):
    default_config = load_default_rest_api_config()
    config_dir = get_config_dir()
    conf_file = os.path.join(config_dir, 'rest_api.toml')

    toml_config = load_toml_rest_api_config(conf_file)
    return merge_rest_api_config(
        configs=[first_config, toml_config, default_config])
Example #2
0
def load_rest_api_config(first_config):
    default_config = load_default_rest_api_config()
    config_dir = get_config_dir()
    conf_file = os.path.join(config_dir, 'rest_api.toml')

    toml_config = load_toml_rest_api_config(conf_file)
    return merge_rest_api_config(
        configs=[first_config, toml_config, default_config])
Example #3
0
    def test_rest_api_defaults_sawtooth_home(self):
        """Tests the default REST API configuration.

            - bind = ["127.0.0.1:8080"]
            - connect = "tcp://localhost:4004"
            - timeout = 300

        """
        config = load_default_rest_api_config()
        self.assertEqual(config.bind , ["127.0.0.1:8080"])
        self.assertEqual(config.connect, "tcp://localhost:4004")
        self.assertEqual(config.timeout, 300)
Example #4
0
    def test_rest_api_defaults_sawtooth_home(self):
        """Tests the default REST API configuration.

            - bind = ["127.0.0.1:8008"]
            - connect = "tcp://localhost:4004"
            - timeout = 300

        """
        config = load_default_rest_api_config()
        self.assertEqual(config.bind, ["127.0.0.1:8008"])
        self.assertEqual(config.connect, "tcp://localhost:4004")
        self.assertEqual(config.timeout, 300)