Esempio n. 1
0
 def test_pass_on_injected_format(self):
     task = TTextDataTask(
         text_data=target(
             scenario_path("data/some_unknown_ext.myext"), config=file.txt
         )
     )
     assert_run_task(task)
Esempio n. 2
0
    def test_from_extra_config(self):
        class MyTaskWithConfg(TTask):
            parameter_with_config = parameter[str]

            def __init__(self, **kwargs):
                super(MyTaskWithConfg, self).__init__(**kwargs)

            def run(self):
                super(MyTaskWithConfg, self).run()
                assert self.parameter_with_config == "value_from_config"

        assert dbnd_run_cmd("MyTaskWithConfg --conf-file %s" %
                            scenario_path("config_files/test_cfg_switch.cfg"))
Esempio n. 3
0
 def band(self):
     count = WordCount(text=scenario_path("data/some_log.txt"))
     self.counter = count.counters
Esempio n. 4
0
 def test_read_(self):
     actual = read_from_config_files(
         [scenario_path("config_files", "test_config_reader.cfg")])
     with config(actual):
         assert (config.get("test_config_reader",
                            "test_config_reader") == "test_value")
Esempio n. 5
0
 def band(self):
     self.log = target(scenario_path("data/some_log.txt"))
Esempio n. 6
0
 def test_simple36_py(self):
     run_test_notebook(scenario_path("jupyter", "simple-py36.ipynb"))
Esempio n. 7
0
 def test_unknown_format(self):
     task = TTextDataTask(text_data=scenario_path("data/some_unknown_ext.myext"))
     assert_run_task(task)