def test_get_to_param_int_value(self): """Tests that adripy.get_to_param() returns the correct parameter when requesting a parameter that has a string as the value. """ expected_value = 4 actual_value = adripy.get_TO_param(TEST_SOLVER_SETTINGS_FILE, 'Thread_Count') self.assertEqual(actual_value, expected_value)
def test_get_to_param_event_file(self): """Tests that adripy.get_to_param() returns the correct parameter when requesting a parameter that has a string as the value. """ expected_value = '<example_database>\\events.tbl\\test_event.evt' actual_value = adripy.get_TO_param(TEST_EXISTING_STRING_FILE, 'Event_Property_File') self.assertEqual(actual_value, expected_value)
def test_get_to_param_float_value(self): """Tests that adripy.get_to_param() returns the correct parameter when requesting a parameter that has a string as the value. """ expected_value = 32.187 actual_value = adripy.get_TO_param(TEST_EXISTING_STRING_FILE, 'Gravity') self.assertEqual(actual_value, expected_value)
def test_get_to_param_string_value(self): """Tests that adripy.get_to_param() returns the correct parameter when requesting a parameter that has a string as the value. """ expected_value = 'test_string' actual_value = adripy.get_TO_param(TEST_EXISTING_STRING_FILE, 'OutputName') self.assertEqual(actual_value, expected_value)
def test_relativity_in_string_event_reference(self): """Tests that the file references in the string file are relative to drill_sim.directory """ drill_sim = DrillSim(self.drill_string, self.event, self.solver_settings, TEST_WORKING_DIRECTORY, TEST_ANALYSIS_NAME) event_filepath = adripy.get_TO_param( os.path.join(drill_sim.directory, drill_sim.string_filename), 'Event_Property_File') self.assertFalse( thornpy.utilities.convert_path(drill_sim.directory) in thornpy.utilities.convert_path(event_filepath))