Index: test/sasdataloader/test/utest_cansas.py
===================================================================
--- test/sasdataloader/test/utest_cansas.py	(revision b699768550de9d4b35b087234ec1d2a461922bab)
+++ test/sasdataloader/test/utest_cansas.py	(revision d72567eac270b5ba960e7bfa2dac6f9cbc461dbe)
@@ -2,11 +2,7 @@
     Unit tests for the new recursive cansas reader
 """
-import logging
-import warnings
-warnings.simplefilter("ignore")
-
 import sas.sascalc.dataloader.readers.cansas_reader as cansas
 from sas.sascalc.dataloader.loader import Loader
-from sas.sascalc.dataloader.data_info import Data1D
+from sas.sascalc.dataloader.data_info import Data1D, Data2D
 from sas.sascalc.dataloader.readers.xml_reader import XMLreader
 from sas.sascalc.dataloader.readers.cansas_reader import Reader
@@ -20,13 +16,17 @@
 import unittest
 import numpy
+import logging
+import warnings
 
 from lxml import etree
 from xml.dom import minidom
- 
+
+warnings.simplefilter("ignore")
+
 CANSAS_FORMAT = CansasConstants.CANSAS_FORMAT
 CANSAS_NS = CansasConstants.CANSAS_NS
-    
-class cansas_reader(unittest.TestCase):
-    
+
+class cansas_reader_xml(unittest.TestCase):
+
     def setUp(self):
         self.loader = Loader()
@@ -43,6 +43,6 @@
         self.schema_1_0 = "cansas1d_v1_0.xsd"
         self.schema_1_1 = "cansas1d_v1_1.xsd"
-        
-    
+
+
     def get_number_of_entries(self, dictionary, name, i):
         if dictionary.get(name) is not None:
@@ -52,6 +52,6 @@
             name = self.get_number_of_entries(dictionary, name, i)
         return name
-    
-    
+
+
     def test_invalid_xml(self):
         """
@@ -60,5 +60,5 @@
         invalid = StringIO.StringIO('<a><c></b></a>')
         reader = XMLreader(invalid)
-       
+
 
     def test_xml_validate(self):
@@ -78,6 +78,6 @@
         self.assertTrue(xmlschema.validate(valid))
         self.assertFalse(xmlschema.validate(invalid))
-        
-        
+
+
     def test_real_xml(self):
         reader = XMLreader(self.xml_valid, self.schema_1_0)
@@ -87,6 +87,6 @@
         else:
             self.assertFalse(valid)
-            
-            
+
+
     def _check_data(self, data):
         self.assertTrue(data.title == "TK49 c10_SANS")
@@ -101,11 +101,11 @@
         self.assertTrue(data.process[0].name == "Mantid generated CanSAS1D XML")
         self.assertTrue(data.meta_data["xmlpreprocess"] != None)
-        
-    
+
+
     def _check_data_1_1(self, data):
         spectrum = data.trans_spectrum[0]
         self.assertTrue(len(spectrum.wavelength) == 138)
-        
-    
+
+
     def test_cansas_xml(self):
         filename = "isis_1_1_write_test.xml"
@@ -132,6 +132,6 @@
             written_data = return_data[0]
             self._check_data(written_data)
-    
-    
+
+
     def test_double_trans_spectra(self):
         xmlreader = XMLreader(self.isis_1_1_doubletrans, self.schema_1_1)
@@ -141,6 +141,6 @@
         for item in data:
             self._check_data(item)
-    
-                    
+
+
     def test_entry_name_recurse(self):
         test_values = [1,2,3,4,5,6]
@@ -151,6 +151,6 @@
             d[new_key] = value
         self.assertTrue(len(d) == 6)
-        
-    
+
+
     def test_load_cansas_file(self):
         valid = []
@@ -169,6 +169,6 @@
         reader7 = XMLreader(self.isis_1_1, self.schema_1_0)
         self.assertFalse(reader7.validate_xml())
-        
-       
+
+
     def test_old_cansas_files(self):
         reader1 = XMLreader(self.cansas1d, self.schema_1_0)
@@ -182,6 +182,6 @@
         reader4 = XMLreader(self.cansas1d_slit, self.schema_1_0)
         self.assertTrue(reader4.validate_xml())
-        
-    
+
+
     def test_save_cansas_v1_0(self):
         filename = "isis_1_0_write_test.xml"
@@ -204,6 +204,6 @@
             self.assertTrue(valid)
             self._check_data(written_data)
-        
-        
+
+
     def test_processing_instructions(self):
         reader = XMLreader(self.isis_1_1, self.schema_1_1)
@@ -214,13 +214,13 @@
             self.assertTrue(dic == {'xml-stylesheet': \
                                     'type="text/xsl" href="cansas1d.xsl" '})
-            
+
             xml = "<test><a><b><c></c></b></a></test>"
             xmldoc = minidom.parseString(xml)
-            
+
             ## take the processing instructions and put them back in
             xmldoc = self.set_processing_instructions(xmldoc, dic)
             xml_output = xmldoc.toprettyxml()
-            
-    
+
+
     def set_processing_instructions(self, minidom_object, dic):
         xmlroot = minidom_object.firstChild
@@ -229,6 +229,6 @@
             minidom_object.insertBefore(pi, xmlroot)
         return minidom_object
-    
-    
+
+
     def get_processing_instructions(self, xml_reader_object):
         dict = {}
@@ -247,5 +247,64 @@
             pi = pi.getprevious()
         return dict
-        
+
+
+class cansas_reader_hdf5(unittest.TestCase):
+
+    def setUp(self):
+        self.loader = Loader()
+        self.datafile_basic = "simpleexamplefile.h5"
+        self.datafile_multiplesasentry = "cansas_1Dand2D_samedatafile.h5"
+        self.datafile_multiplesasdata = "cansas_1Dand2D_samesasentry.h5"
+        self.datafile_multiplesasdata_multiplesasentry = "cansas_1Dand2D_multiplesasentry_multiplesasdata.h5"
+
+    def test_real_data(self):
+        self.data = self.loader.load(self.datafile_basic)
+        self._check_example_data(self.data[0])
+
+    def test_multiple_sasentries(self):
+        self.data = self.loader.load(self.datafile_multiplesasentry)
+        self.assertTrue(len(self.data) == 2)
+        self._check_multiple_data(self.data[0])
+        self._check_multiple_data(self.data[1])
+        self._check_1d_data(self.data[0])
+
+    def _check_multiple_data(self, data):
+        self.assertTrue(data.title == "MH4_5deg_16T_SLOW")
+        self.assertTrue(data.run[0] == '33837')
+        self.assertTrue(len(data.run) == 1)
+        self.assertTrue(data.instrument == "SANS2D")
+        self.assertTrue(data.source.radiation == "Spallation Neutron Source")
+        self.assertTrue(len(data.detector) == 1)
+        self.assertTrue(data.detector[0].name == "rear-detector")
+        self.assertTrue(data.detector[0].distance == 4.385281)
+        self.assertTrue(data.detector[0].distance_unit == 'm')
+        self.assertTrue(len(data.trans_spectrum) == 1)
+
+    def _check_1d_data(self, data):
+        self.assertTrue(isinstance(data, Data1D))
+        self.assertTrue(len(data.x) == 66)
+        self.assertTrue(len(data.x) == len(data.y))
+        self.assertTrue(data.dy[10] == 0.20721350111248701)
+        self.assertTrue(data.y[10] == 24.193889608153476)
+        self.assertTrue(data.x[10] == 0.008981127988654792)
+
+    def _check_2d_data(self, data):
+        self.assertTrue(isinstance(data, Data2D))
+        self.assertTrue(len(data.x) == 66)
+        self.assertTrue(len(data.x) == len(data.y))
+        self.assertTrue(data.dy[10] == 0.20721350111248701)
+        self.assertTrue(data.y[10] == 24.193889608153476)
+        self.assertTrue(data.x[10] == 0.008981127988654792)
+
+    def _check_example_data(self, data):
+        self.assertTrue(data.title == "")
+        self.assertTrue(data.x.size == 100)
+        self.assertTrue(data._xunit == "A^{-1}")
+        self.assertTrue(data._yunit == "cm^{-1}")
+        self.assertTrue(data.y.size == 100)
+        self.assertAlmostEqual(data.y[9], 0.952749011516985)
+        self.assertAlmostEqual(data.x[9], 0.3834415188257777)
+        self.assertAlmostEqual(len(data.meta_data), 0)
+
 
 if __name__ == '__main__':
