예제 #1
0
    def test_only_host_path(self, mock_get):
        mock_get.return_value = "/foo/bar/host:"

        returned_dict = _get_mount_path("service-init")
        expected_dict = {"host_path": "/foo/bar/host",
                         "container_path": ""}
        self.assertEqual(expected_dict, returned_dict)
예제 #2
0
    def test_host_path_is_specifed(self, mock_conf):
        mock_conf.return_value = "/foo/bar/host:"

        returned_dict = _get_mount_path("test")
        expected_dict = {"host_path": "/foo/bar/host",
                         "container_path": ""}
        self.assertEqual(expected_dict, returned_dict)
예제 #3
0
    def test_if_service_name_is_changed(self, mock_conf):
        mock_conf.return_value = "test:test"

        _get_mount_path("foo-bar")
        mock_conf.assert_called_with("foo_bar_mpath")
예제 #4
0
    def test_opt_does_not_exist(self, mock_conf):
        mock_conf.side_effect = cfg.NoSuchOptError("")

        returned_dict = _get_mount_path("test")
        expected_dict = {}
        self.assertEqual(expected_dict, returned_dict)