Esempio n. 1
0
 def test_execute_not_found(self, empty_options, empty_suboptions,
                            test_data_source, nonedefault_store):
     empty_options.store = nonedefault_store.path
     with patch("__builtin__.print") as print_patched:
         DataSourceTestCommand.execute(empty_options, empty_suboptions, "xxxx")
         print_patched.assert_called_with("Datasource `xxxx` not found, NOT TESTED")
Esempio n. 2
0
 def test_invalid_params(self, empty_options, empty_suboptions, test_data_source,
                         nonedefault_store):
     empty_options.store = nonedefault_store.path
     # DataSource takes one param
     with pytest.raises(InvalidParams):
         DataSourceTestCommand.execute(empty_options, empty_suboptions)
Esempio n. 3
0
 def test_execute(self, empty_options, empty_suboptions, test_data_source, nonedefault_store):
     test_data_source.test.return_value = True
     empty_options.store = nonedefault_store.path
     DataSourceTestCommand.execute(empty_options, empty_suboptions, "datasource one")
     test_data_source.test.assert_called