2024-12-08 19:33:06 -06:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# -*- coding: utf-8; -*-
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								import os
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								from unittest.mock import MagicMock, patch
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								from wuttjamaican.testing import ConfigTestCase
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								from wuttjamaican.cli import make_appdir as mod
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								from wuttjamaican.app import AppHandler
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								here = os.path.dirname(__file__)
							 | 
						
					
						
							
								
									
										
										
										
											2025-08-30 21:25:44 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								example_conf = os.path.join(here, "example.conf")
							 | 
						
					
						
							
								
									
										
										
										
											2024-12-08 19:33:06 -06:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								class TestMakeAppdir(ConfigTestCase):
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    def test_basic(self):
							 | 
						
					
						
							
								
									
										
										
										
											2025-08-30 21:25:44 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        appdir = os.path.join(self.tempdir, "app")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        ctx = MagicMock(params={"config_paths": [example_conf], "appdir_path": appdir})
							 | 
						
					
						
							
								
									
										
										
										
											2024-12-08 19:33:06 -06:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        ctx.parent.wutta_config = self.config
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2025-08-30 21:25:44 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        with patch.object(AppHandler, "make_appdir") as make_appdir:
							 | 
						
					
						
							
								
									
										
										
										
											2024-12-08 19:33:06 -06:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            mod.make_appdir(ctx)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            make_appdir.assert_called_once_with(appdir)
							 |