Beispiel #1
0
    def test_get_apps_ignores_files_in_apps_directory(self):
        """Test the _get_apps method ignore standard files in the apps_directory"""

        # Create file to ignore
        self.fs.create_file("apps/foo")

        lkp = AppsLookupModule()
        apps_path = "apps"

        apps = lkp._get_apps(apps_path)
        self.assertEqual(len(apps), 1)
Beispiel #2
0
    def test_get_apps(self):
        """Test the _get_apps method"""

        # Create a supplementary hello app
        app_files = (
            ("apps/hello/templates/services/app/dc.yml.j2", ""),
            ("apps/hello/templates/services/app/route.yml.j2", ""),
            ("apps/hello/templates/services/app/svc.yml.j2", ""),
            ("apps/hello/tray.yml", "metadata:\n  name: hello\n  version: 1.0.0\n"),
            ("apps/hello/vars/all/main.yml", ""),
        )
        for file_path, file_content in app_files:
            self.fs.create_file(file_path, contents=file_content)

        lkp = AppsLookupModule()
        apps_path = "apps"

        apps = lkp._get_apps(apps_path)
        self.assertEqual(len(apps), 2)