File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 2121namespace py = pybind11;
2222
2323void bindPyConfig (py::module &m) {
24- py::class_<casbin::Config>(m, " Config" )
24+ py::class_<casbin::Config, std::shared_ptr<casbin::Config> >(m, " Config" )
2525 .def (py::init<>())
2626 .def (py::init<const std::string&>())
2727 .def_static (" NewConfig" , &casbin::Config::NewConfig, R"doc(
Original file line number Diff line number Diff line change @@ -64,6 +64,8 @@ class Config : public ConfigInterface {
6464
6565 bool GetBool (std::string_view key);
6666
67+ Config ();
68+
6769 Config (const std::string& conf_name);
6870
6971 int GetInt (std::string_view key);
Original file line number Diff line number Diff line change @@ -45,9 +45,9 @@ def test_NewModelFromString(self):
4545 self .assertIsNotNone (model )
4646
4747 def test_LoadModelFromConfig (self ):
48- # config = casbin.Config(basic_model_path)
49- # model = casbin.Model.NewModel()
50- # casbin .LoadModelFromConfig(model, basic_config)
48+ basic_config = casbin .Config . NewConfig (basic_model_path )
49+ model = casbin .Model .NewModel ()
50+ model .LoadModelFromConfig (basic_config )
5151 # model = casbin.Model.NewModel()
5252 # config = casbin.Config.NewConfigFromText("")
5353 # model.LoadModelFromConfig(config)
You can’t perform that action at this time.
0 commit comments