Ticket #5910 (closed: fixed)

Opened 8 years ago

Last modified 5 years ago

ScopedFile

Reported by: Owen Arnold Owned by: Owen Arnold
Priority: minor Milestone: Release 2.3
Component: Mantid Keywords:
Cc: Blocked By:
Blocking: Tester: Anders Markvardsen

Description

I've been using the concept of a scoped file in a few unit tests.

Would be nice to have this as a common resource available for all unit tests.

Change History

comment:1 Changed 8 years ago by Owen Arnold

  • Status changed from new to accepted

comment:2 Changed 8 years ago by Owen Arnold

refs #5910 #5900. ScopedFile.

This will be used in the IDF refactoring tests quite heavily too.

Changeset: 92ff1396d2978cf8a3c2d2b9b02358f8070546a6

comment:3 Changed 8 years ago by Owen Arnold

refs #5910 #5900. Refactor Geom tests to use ScopedFile.

Changeset: ef78e27e9c48c85062eb8f7fa082197b6d2b97cd

comment:4 Changed 8 years ago by Owen Arnold

refs #5910 #5900. ScopedFile.

This will be used in the IDF refactoring tests quite heavily too.

Changeset: 9b08684a0389215a165daee29742e751447cd063

comment:5 Changed 8 years ago by Owen Arnold

refs #5910 #5900. Refactor Geom tests to use ScopedFile.

Changeset: 7be5bdb69fe48e733dd60ef6c4af88632138166b

comment:6 Changed 8 years ago by Owen Arnold

  • Status changed from accepted to verify
  • Resolution set to fixed

Tester: The scoped file object is a handle to a file resource that it generates upon construction, and clears-up upon deletion. Check that the modified unit tests work successfully using the file resource, and that any created files are automatically removed in the presence of an exception, or when the object goes out of scope.

Note that this feature could/should be moved to Kernel if it turns out to be more useful than just for testing.

comment:7 Changed 8 years ago by Karl Palmen

I used scoped file in a unit test for ticket #5915 , which checks that an appropriate exception is thrown if one attempts to lead and empty instrument from an IDF file without a detector.

comment:8 Changed 8 years ago by Anders Markvardsen

  • Status changed from verify to verifying
  • Tester set to Anders Markvardsen

comment:9 Changed 8 years ago by Anders Markvardsen

  • Status changed from verifying to closed

ScopedFileHelper now used successfully in several unit tests

comment:10 Changed 8 years ago by Owen Arnold

refs #5910 #5900. ScopedFile.

This will be used in the IDF refactoring tests quite heavily too.

Changeset: 9b08684a0389215a165daee29742e751447cd063

comment:11 Changed 8 years ago by Owen Arnold

refs #5910 #5900. Refactor Geom tests to use ScopedFile.

Changeset: 7be5bdb69fe48e733dd60ef6c4af88632138166b

comment:12 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 6756

Note: See TracTickets for help on using tickets.