Test that method :meth:`~pythonforandroid.distribution.Distribution.save_info` is called once with the proper arguments.
(self, mock_open_dist_info, mock_chdir)
| 117 | @mock.patch("pythonforandroid.util.chdir") |
| 118 | @mock.patch("pythonforandroid.distribution.open", create=True) |
| 119 | def test_save_info(self, mock_open_dist_info, mock_chdir): |
| 120 | """Test that method |
| 121 | :meth:`~pythonforandroid.distribution.Distribution.save_info` |
| 122 | is called once with the proper arguments.""" |
| 123 | self.setUp_distribution_with_bootstrap( |
| 124 | Bootstrap().get_bootstrap("sdl2", self.ctx) |
| 125 | ) |
| 126 | self.ctx.hostpython = "/some/fake/hostpython3" |
| 127 | self.ctx.python_recipe = Recipe.get_recipe("python3", self.ctx) |
| 128 | self.ctx.python_modules = ["requests"] |
| 129 | mock_open_dist_info.side_effect = [ |
| 130 | mock.mock_open(read_data=json.dumps(dist_info_data)).return_value |
| 131 | ] |
| 132 | self.ctx.bootstrap.distribution.save_info("/fake_dir") |
| 133 | mock_open_dist_info.assert_called_once_with("dist_info.json", "w") |
| 134 | mock_open_dist_info.reset_mock() |
| 135 | |
| 136 | @mock.patch("pythonforandroid.distribution.open", create=True) |
| 137 | @mock.patch("pythonforandroid.distribution.exists") |
nothing calls this directly
no test coverage detected