Index: test/sasinvariant/test/utest_use_cases.py
===================================================================
--- test/sasinvariant/test/utest_use_cases.py	(revision 959eb0181ad06828a748f04512f953aad5b31659)
+++ test/sasinvariant/test/utest_use_cases.py	(revision b09095a7f7ba6ae5e7ee28a9d240400222cbae19)
@@ -6,10 +6,11 @@
 import unittest
 from sas.sascalc.dataloader.loader import  Loader
-
 from sas.sascalc.invariant import invariant
+
 
 class Data1D:
     pass
-    
+
+
 class TestLineFit(unittest.TestCase):
     """
@@ -17,15 +18,16 @@
     """
     def setUp(self):
-        self.data = Loader().load("linefittest.txt")
-        
+        self.data_list = Loader().load("linefittest.txt")
+        self.data = self.data_list[0]
+
     def test_fit_line_data(self):
         """ 
             Fit_Test_1: test linear fit, ax +b, without fixed
         """
-        
+
         # Create invariant object. Background and scale left as defaults.
         fit = invariant.Extrapolator(data=self.data)
         
-        ##Without holding
+        # Without holding
         p, dp = fit.fit(power=None)
 
@@ -33,5 +35,4 @@
         self.assertAlmostEquals(p[0], 2.3983,3)
         self.assertAlmostEquals(p[1], 0.87833,3)
-
 
     def test_fit_line_data_fixed(self):
@@ -39,9 +40,9 @@
             Fit_Test_2: test linear fit, ax +b, with 'a' fixed
         """
-        
+
         # Create invariant object. Background and scale left as defaults.
         fit = invariant.Extrapolator(data=self.data)
-        
-        #With holding a = -power =4
+
+        # With holding a = -power =4
         p, dp = fit.fit(power=-4)
 
@@ -49,5 +50,6 @@
         self.assertAlmostEquals(p[0], 4)
         self.assertAlmostEquals(p[1], -4.0676,3)
-        
+
+
 class TestLineFitNoweight(unittest.TestCase):
     """
@@ -55,15 +57,16 @@
     """
     def setUp(self):
-        self.data = Loader().load("linefittest_no_weight.txt")
-        
+        self.data_list = Loader().load("linefittest_no_weight.txt")
+        self.data = self.data_list[0]
+
     def skip_test_fit_line_data_no_weight(self):
         """ 
             Fit_Test_1: test linear fit, ax +b, without fixed
         """
-        
+
         # Create invariant object. Background and scale left as defaults.
         fit = invariant.Extrapolator(data=self.data)
-        
-        ##Without holding
+
+        # Without holding
         p, dp = fit.fit(power=None)
 
@@ -71,5 +74,4 @@
         self.assertAlmostEquals(p[0], 2.4727,3)
         self.assertAlmostEquals(p[1], 0.6,3)
-
 
     def test_fit_line_data_fixed_no_weight(self):
@@ -77,8 +79,8 @@
             Fit_Test_2: test linear fit, ax +b, with 'a' fixed
         """
-        
+
         # Create invariant object. Background and scale left as defaults.
         fit = invariant.Extrapolator(data=self.data)
-        
+
         #With holding a = -power =4
         p, dp = fit.fit(power=-4)
@@ -87,5 +89,6 @@
         self.assertAlmostEquals(p[0], 4)
         self.assertAlmostEquals(p[1], -7.8,3)
-                
+
+
 class TestInvPolySphere(unittest.TestCase):
     """
@@ -93,12 +96,11 @@
     """
     def setUp(self):
-        self.data = Loader().load("PolySpheres.txt")
-        
+        self.data_list = Loader().load("PolySpheres.txt")
+        self.data = self.data_list[0]
+
     def test_wrong_data(self):
         """ test receiving Data1D not of type loader"""
-
-
         self.assertRaises(ValueError,invariant.InvariantCalculator, Data1D())
-        
+
     def test_use_case_1(self):
         """
@@ -107,13 +109,14 @@
         # Create invariant object. Background and scale left as defaults.
         inv = invariant.InvariantCalculator(data=self.data)
-        
+
         # We have to be able to tell the InvariantCalculator whether we want the
         # extrapolation or not. By default, when the user doesn't specify, we
-        # should compute Q* without extrapolation. That's what should be done in __init__.
-        
+        # should compute Q* without extrapolation. That's what should be done
+        # in __init__.
+
         # We call get_qstar() with no argument, which signifies that we do NOT
         # want extrapolation.
         qstar = inv.get_qstar()
-        
+
         # The volume fraction and surface use Q*. That means that the following 
         # methods should check that Q* has been computed. If not, it should 
@@ -121,21 +124,21 @@
         v, dv = inv.get_volume_fraction_with_error(contrast=2.6e-6)
         s, ds = inv.get_surface_with_error(contrast=2.6e-6, porod_const=2)
-        
+
         # Test results
         self.assertAlmostEquals(qstar, 7.48959e-5,2)
         self.assertAlmostEquals(v, 0.005644689, 4)
         self.assertAlmostEquals(s , 941.7452, 3)
-        
+
     def test_use_case_2(self):
         """
-            Invariant without extrapolation. Invariant, volume fraction and surface 
-            are given with errors.
-        """
-        # Create invariant object. Background and scale left as defaults.
-        inv = invariant.InvariantCalculator(data=self.data)
-        
+        Invariant without extrapolation. Invariant, volume fraction and surface 
+        are given with errors.
+        """
+        # Create invariant object. Background and scale left as defaults.
+        inv = invariant.InvariantCalculator(data=self.data)
+
         # Get the invariant with errors
         qstar, qstar_err = inv.get_qstar_with_error()
-        
+
         # The volume fraction and surface use Q*. That means that the following 
         # methods should check that Q* has been computed. If not, it should 
@@ -147,6 +150,5 @@
         self.assertAlmostEquals(v, 0.005644689, 1)
         self.assertAlmostEquals(s , 941.7452, 3)
-       
-        
+
     def test_use_case_3(self):
         """
@@ -155,21 +157,23 @@
         # Create invariant object. Background and scale left as defaults.
         inv = invariant.InvariantCalculator(data=self.data)
-        
+
         # Set the extrapolation parameters for the low-Q range
-        
+
         # The npts parameter should have a good default.
         # The range parameter should be 'high' or 'low'
         # The function parameter should default to None. If it is None,
-        #    the method should pick a good default (Guinier at low-Q and 1/q^4 at high-Q).
-        #    The method should also check for consistency of the extrapolation and function
-        #    parameters. For instance, you might not want to allow 'high' and 'guinier'.
+        #    the method should pick a good default
+        #    (Guinier at low-Q and 1/q^4 at high-Q).
+        #    The method should also check for consistency of the extrapolation
+        #    and function parameters. For instance, you might not want to allow
+        #    'high' and 'guinier'.
         # The power parameter (not shown below) should default to 4.
         inv.set_extrapolation(range='low', npts=10, function='guinier')
-        
-        # The version of the call without error
-        # At this point, we could still compute Q* without extrapolation by calling
-        # get_qstar with arguments, or with extrapolation=None.
+
+        # The version of the call without error
+        # At this point, we could still compute Q* without extrapolation by
+        # calling get_qstar with arguments, or with extrapolation=None.
         qstar = inv.get_qstar(extrapolation='low')
-        
+
         # The version of the call with error
         qstar, qstar_err = inv.get_qstar_with_error(extrapolation='low')
@@ -178,10 +182,10 @@
         v, dv = inv.get_volume_fraction_with_error(contrast=2.6e-6)
         s, ds = inv.get_surface_with_error(contrast=2.6e-6, porod_const=2)
-        
+
         # Test results
         self.assertAlmostEquals(qstar, 7.49e-5, 1)
         self.assertAlmostEquals(v, 0.005648401, 4)
         self.assertAlmostEquals(s , 941.7452, 3)
-            
+
     def test_use_case_4(self):
         """
@@ -190,12 +194,14 @@
         # Create invariant object. Background and scale left as defaults.
         inv = invariant.InvariantCalculator(data=self.data)
+
+        # Set the extrapolation parameters for the high-Q range
+        inv.set_extrapolation(range='high', npts=10, function='power_law',
+                              power=4)
         
-        # Set the extrapolation parameters for the high-Q range
-        inv.set_extrapolation(range='high', npts=10, function='power_law', power=4)
-        
-        # The version of the call without error
-        # The function parameter defaults to None, then is picked to be 'power_law' for extrapolation='high'
+        # The version of the call without error
+        # The function parameter defaults to None, then is picked to be
+        # 'power_law' for extrapolation='high'
         qstar = inv.get_qstar(extrapolation='high')
-        
+
         # The version of the call with error
         qstar, qstar_err = inv.get_qstar_with_error(extrapolation='high')
@@ -204,10 +210,10 @@
         v, dv = inv.get_volume_fraction_with_error(contrast=2.6e-6)
         s, ds = inv.get_surface_with_error(contrast=2.6e-6, porod_const=2)
-        
+
         # Test results
         self.assertAlmostEquals(qstar, 7.49e-5,2)
         self.assertAlmostEquals(v, 0.005952674, 3)
         self.assertAlmostEquals(s , 941.7452, 3)
-        
+
     def test_use_case_5(self):
         """
@@ -216,11 +222,13 @@
         # Create invariant object. Background and scale left as defaults.
         inv = invariant.InvariantCalculator(data=self.data)
-        
+
         # Set the extrapolation parameters for the low- and high-Q ranges
         inv.set_extrapolation(range='low', npts=10, function='guinier')
-        inv.set_extrapolation(range='high', npts=10, function='power_law', power=4)
-        
-        # The version of the call without error
-        # The function parameter defaults to None, then is picked to be 'power_law' for extrapolation='high'
+        inv.set_extrapolation(range='high', npts=10, function='power_law',
+                              power=4)
+
+        # The version of the call without error
+        # The function parameter defaults to None, then is picked to be
+        # 'power_law' for extrapolation='high'
         qstar = inv.get_qstar(extrapolation='both')
         
@@ -231,10 +239,10 @@
         v, dv = inv.get_volume_fraction_with_error(contrast=2.6e-6)
         s, ds = inv.get_surface_with_error(contrast=2.6e-6, porod_const=2)
-        
+
         # Test results
         self.assertAlmostEquals(qstar, 7.88981e-5,2)
         self.assertAlmostEquals(v, 0.005952674, 3)
         self.assertAlmostEquals(s , 941.7452, 3)
-      
+
     def test_use_case_6(self):
         """
@@ -243,12 +251,12 @@
         # Create invariant object. Background and scale left as defaults.
         inv = invariant.InvariantCalculator(data=self.data)
-        
+
         # Set the extrapolation parameters for the high-Q range
         inv.set_extrapolation(range='low', npts=10, function='power_law', power=4)
-        
+
         # The version of the call without error
         # The function parameter defaults to None, then is picked to be 'power_law' for extrapolation='high'
         qstar = inv.get_qstar(extrapolation='low')
-        
+
         # The version of the call with error
         qstar, qstar_err = inv.get_qstar_with_error(extrapolation='low')
@@ -257,10 +265,11 @@
         v, dv = inv.get_volume_fraction_with_error(contrast=2.6e-6)
         s, ds = inv.get_surface_with_error(contrast=2.6e-6, porod_const=2)
-        
+
         # Test results
         self.assertAlmostEquals(qstar, 7.49e-5,2)
         self.assertAlmostEquals(v, 0.005952674, 3)
         self.assertAlmostEquals(s , 941.7452, 3)
-        
+
+
 class TestInvPinholeSmear(unittest.TestCase):
     """
@@ -271,5 +280,5 @@
         list = Loader().load("latex_smeared.xml")
         self.data_q_smear = list[0]
-    
+
     def test_use_case_1(self):
         """
@@ -278,5 +287,5 @@
         inv = invariant.InvariantCalculator(data=self.data_q_smear)
         qstar = inv.get_qstar()
-        
+
         v = inv.get_volume_fraction(contrast=2.6e-6)
         s = inv.get_surface(contrast=2.6e-6, porod_const=2)
@@ -285,5 +294,5 @@
         self.assertAlmostEquals(v, 0.115352622, 2)
         self.assertAlmostEquals(s , 941.7452, 3 )
-        
+
     def test_use_case_2(self):
         """
@@ -293,5 +302,5 @@
         # Create invariant object. Background and scale left as defaults.
         inv = invariant.InvariantCalculator(data=self.data_q_smear)
-        
+
         # Get the invariant with errors
         qstar, qstar_err = inv.get_qstar_with_error()
@@ -303,5 +312,5 @@
         self.assertAlmostEquals(v, 0.115352622, 2)
         self.assertAlmostEquals(s , 941.7452, 3 )
-       
+
     def test_use_case_3(self):
         """
@@ -319,10 +328,10 @@
         v, dv = inv.get_volume_fraction_with_error(contrast=2.6e-6)
         s, ds = inv.get_surface_with_error(contrast=2.6e-6, porod_const=2)
-        
+
         # Test results
         self.assertAlmostEquals(qstar, 0.00138756,2)
         self.assertAlmostEquals(v, 0.117226896,2)
         self.assertAlmostEquals(s ,941.7452, 3)
-      
+
     def test_use_case_4(self):
         """
@@ -337,16 +346,8 @@
         # The version of the call with error
         qstar, qstar_err = inv.get_qstar_with_error(extrapolation='high')
-        
-        # Get the volume fraction and surface
-        # WHY SHOULD THIS FAIL?
-        #self.assertRaises(RuntimeError, inv.get_volume_fraction_with_error, 2.6e-6)
-        
-        # Check that an exception is raised when the 'surface' is not defined
-        # WHY SHOULD THIS FAIL?
-        #self.assertRaises(RuntimeError, inv.get_surface_with_error, 2.6e-6, 2)
 
         # Test results
         self.assertAlmostEquals(qstar, 0.0045773,2)
-       
+
     def test_use_case_5(self):
         """
@@ -357,16 +358,13 @@
         # Set the extrapolation parameters for the low- and high-Q ranges
         inv.set_extrapolation(range='low', npts=10, function='guinier')
-        inv.set_extrapolation(range='high', npts=10, function='power_law', power=4)
-        # The version of the call without error
-        # The function parameter defaults to None, then is picked to be 'power_law' for extrapolation='high'
+        inv.set_extrapolation(range='high', npts=10, function='power_law',
+                              power=4)
+        # The version of the call without error
+        # The function parameter defaults to None, then is picked to be
+        # 'power_law' for extrapolation='high'
         qstar = inv.get_qstar(extrapolation='both')
         # The version of the call with error
         qstar, qstar_err = inv.get_qstar_with_error(extrapolation='both')
-        
-        # Get the volume fraction and surface
-        # WHY SHOULD THIS FAIL?
-        #self.assertRaises(RuntimeError, inv.get_volume_fraction_with_error, 2.6e-6)
-        #self.assertRaises(RuntimeError, inv.get_surface_with_error, 2.6e-6, 2)
-        
+
         # Test results
         self.assertAlmostEquals(qstar, 0.00460319,3)
