def test_resource_files_collection_noscript(self): obj = GrinderExecutor() obj.engine = EngineEmul() obj.execution.merge({"scenario": {"properties-file": "tests/grinder/grinder.properties"}}) res_files = obj.resource_files() artifacts = os.listdir(obj.engine.artifacts_dir) self.assertEqual(len(res_files), 2) self.assertEqual(len(artifacts), 2)
def test_resource_files_collection_remote(self): obj = GrinderExecutor() obj.engine = EngineEmul() obj.execution.merge({"scenario": {"script": __dir__() + "/../grinder/helloworld.py", "properties-file": __dir__() + "/../grinder/grinder.properties"}}) res_files = obj.resource_files() artifacts = os.listdir(obj.engine.artifacts_dir) self.assertEqual(len(res_files), 2) self.assertEqual(len(artifacts), 2)
def test_resource_files_collection_basic(self): obj = GrinderExecutor() obj.engine = EngineEmul() obj.execution.merge({ "scenario": { "script": __dir__() + "/../resources/grinder/helloworld.py" } }) res_files = obj.resource_files() self.assertEqual(len(res_files), 1)
def test_resource_files_collection_noscript(self): obj = GrinderExecutor() obj.engine = EngineEmul() obj.execution.merge({ "scenario": { "properties-file": "tests/grinder/grinder.properties" } }) res_files = obj.resource_files() artifacts = os.listdir(obj.engine.artifacts_dir) self.assertEqual(len(res_files), 2) self.assertEqual(len(artifacts), 2)
def test_resource_files_collection_invalid(self): obj = GrinderExecutor() obj.engine = EngineEmul() obj.execution.merge({"scenario": {"script": "tests/grinder/helloworld.py", "properties-file": "tests/grinder/grinder_invalid.properties"}}) res_files = obj.resource_files() artifacts = os.listdir(obj.engine.artifacts_dir) self.assertEqual(len(res_files), 2) self.assertEqual(len(artifacts), 2) self.assertIn("helloworld.py", open(os.path.join(obj.engine.artifacts_dir, "grinder_invalid.properties")).read())
def test_resource_files_collection_invalid(self): obj = GrinderExecutor() obj.engine = EngineEmul() obj.execution.merge({"scenario": {"script": __dir__() + "/../grinder/helloworld.py", "properties-file": __dir__() + "/../grinder/grinder_invalid.properties"}}) res_files = obj.resource_files() artifacts = os.listdir(obj.engine.artifacts_dir) self.assertEqual(len(res_files), 2) self.assertEqual(len(artifacts), 2) self.assertIn("helloworld.py", open(os.path.join(obj.engine.artifacts_dir, "grinder_invalid.properties")).read())
def test_resource_files_collection_basic(self): obj = GrinderExecutor() obj.engine = EngineEmul() obj.execution.merge({"scenario": {"script": __dir__() + "/../grinder/helloworld.py"}}) res_files = obj.resource_files() self.assertEqual(len(res_files), 1)