Пример #1
0
 def test_plugin_manager_python_2(self):
     pm = ErtPluginManager()
     self.assertEqual(pm.get_installable_workflow_jobs(), None)
     self.assertEqual(pm.get_installable_jobs(), None)
     self.assertEqual(pm.get_flow_config_path(), None)
     self.assertEqual(pm.get_ecl100_config_path(), None)
     self.assertEqual(pm.get_ecl300_config_path(), None)
     self.assertEqual(pm.get_rms_config_path(), None)
     self.assertEqual(pm.get_help_links(), None)
     self.assertEqual(pm.get_site_config_content(), None)
Пример #2
0
    def test_with_plugins(self):
        pm = ErtPluginManager(
            plugins=[ert_shared.hook_implementations, dummy_plugins])
        self.assertDictEqual(
            {
                "GitHub page": "https://github.com/equinor/ert",
                "test": "test",
                "test2": "test",
            },
            pm.get_help_links(),
        )
        self.assertEqual("/dummy/path/flow_config.yml",
                         pm.get_flow_config_path())
        self.assertEqual("/dummy/path/rms_config.yml",
                         pm.get_rms_config_path())
        self.assertEqual("/dummy/path/ecl100_config.yml",
                         pm.get_ecl100_config_path())
        self.assertEqual("/dummy/path/ecl300_config.yml",
                         pm.get_ecl300_config_path())

        self.assertIn(("job1", "/dummy/path/job1"),
                      pm.get_installable_jobs().items())
        self.assertIn(("job2", "/dummy/path/job2"),
                      pm.get_installable_jobs().items())
        self.assertIn(
            ("wf_job1", "/dummy/path/wf_job1"),
            pm._get_config_workflow_jobs().items(),
        )
        self.assertIn(
            ("wf_job2", "/dummy/path/wf_job2"),
            pm._get_config_workflow_jobs().items(),
        )

        self.assertListEqual(
            [
                "-- Content below originated from ert (site_config_lines)",
                "JOB_SCRIPT job_dispatch.py",
                "QUEUE_OPTION LOCAL MAX_RUNNING 1",
                "ANALYSIS_LOAD RML_ENKF rml_enkf.{}".format(_lib_extension),
                "-- Content below originated from dummy (site_config_lines)",
                "JOB_SCRIPT job_dispatch_dummy.py",
                "QUEUE_OPTION LOCAL MAX_RUNNING 2",
            ],
            pm._site_config_lines(),
        )
Пример #3
0
    def test_no_plugins(self):
        pm = ErtPluginManager(plugins=[ert_shared.hook_implementations])
        self.assertDictEqual({"GitHub page": "https://github.com/equinor/ert"},
                             pm.get_help_links())
        self.assertIsNone(pm.get_flow_config_path())
        self.assertIsNone(pm.get_ecl100_config_path())
        self.assertIsNone(pm.get_ecl300_config_path())
        self.assertIsNone(pm.get_rms_config_path())

        self.assertLess(0, len(pm.get_installable_jobs()))
        self.assertLess(0, len(pm.get_installable_workflow_jobs()))

        self.assertListEqual(
            [
                "-- Content below originated from ert (site_config_lines)",
                "JOB_SCRIPT job_dispatch.py",
                "QUEUE_OPTION LOCAL MAX_RUNNING 1",
            ],
            pm._site_config_lines(),
        )