2727from pypiscout .SCout_Logger import Logger as sc
2828from matplotlib import pyplot as plt
2929
30- sys .path .append (os .path .join (os .path .dirname (__file__ ), ".." , ".." , "Emma" ))
30+ sys .path .append (os .path .join (os .path .dirname (__file__ ), ".." , ".." ))
3131# pylint: disable=wrong-import-position
3232# Rationale: This module needs to access modules that are above them in the folder structure.
3333
34- import emma
35- import emma_vis
36- from shared_libs .stringConstants import * # pylint: disable=unused-wildcard-import,wildcard-import
34+ import Emma . emma
35+ import Emma . emma_vis
36+ from Emma . shared_libs .stringConstants import * # pylint: disable=unused-wildcard-import,wildcard-import
3737
3838
3939class TestHelper (unittest .TestCase ):
@@ -122,8 +122,8 @@ def test_normalRun(self):
122122 Check that an ordinary run is successful
123123 """
124124 try :
125- args = emma .parseArgs (["--project" , self .cmdLineTestProjectFolder , "--mapfiles" , self .cmdLineTestProjectMapfilesFolder , "--dir" , self .cmdLineTestOutputFolder ])
126- emma .main (args )
125+ args = Emma . emma .parseArgs (["--project" , self .cmdLineTestProjectFolder , "--mapfiles" , self .cmdLineTestProjectMapfilesFolder , "--dir" , self .cmdLineTestOutputFolder ])
126+ Emma . emma .main (args )
127127 except Exception as e : # pylint: disable=broad-except
128128 # Rationale: The purpose here is to catch any exception.
129129 self .fail ("Unexpected exception: " + str (e ))
@@ -133,44 +133,44 @@ def test_help(self):
133133 Check that `--help` does not raise an exception but exits with SystemExit(0)
134134 """
135135 with self .assertRaises (SystemExit ) as context :
136- args = emma .parseArgs (["--help" ])
137- emma .main (args )
136+ args = Emma . emma .parseArgs (["--help" ])
137+ Emma . emma .main (args )
138138 self .assertEqual (context .exception .code , 0 )
139139
140140 def test_unrecognisedArgs (self ):
141141 """
142142 Check that an unexpected argument does raise an exception
143143 """
144144 with self .assertRaises (SystemExit ) as context :
145- args = emma .parseArgs (["--project" , self .cmdLineTestProjectFolder , "--mapfiles" , self .cmdLineTestProjectMapfilesFolder , "--dir" , self .cmdLineTestOutputFolder , "--blahhhhhh" ])
146- emma .main (args )
145+ args = Emma . emma .parseArgs (["--project" , self .cmdLineTestProjectFolder , "--mapfiles" , self .cmdLineTestProjectMapfilesFolder , "--dir" , self .cmdLineTestOutputFolder , "--blahhhhhh" ])
146+ Emma . emma .main (args )
147147 self .assertEqual (context .exception .code , 2 )
148148
149149 def test_noProjDir (self ):
150150 """
151151 Check run with non-existing project folder
152152 """
153153 with self .assertRaises (SystemExit ) as context :
154- args = emma .parseArgs (["--project" , self .nonExistingPath , "--mapfiles" , self .cmdLineTestProjectMapfilesFolder , "--dir" , self .cmdLineTestOutputFolder ])
155- emma .main (args )
154+ args = Emma . emma .parseArgs (["--project" , self .nonExistingPath , "--mapfiles" , self .cmdLineTestProjectMapfilesFolder , "--dir" , self .cmdLineTestOutputFolder ])
155+ Emma . emma .main (args )
156156 self .assertEqual (context .exception .code , - 10 )
157157
158158 def test_noMapfileDir (self ):
159159 """
160160 Check run with non-existing mapfile folder
161161 """
162162 with self .assertRaises (SystemExit ) as context :
163- args = emma .parseArgs (["--project" , self .cmdLineTestProjectFolder , "--mapfiles" , self .nonExistingPath , "--dir" , self .cmdLineTestOutputFolder ])
164- emma .main (args )
163+ args = Emma . emma .parseArgs (["--project" , self .cmdLineTestProjectFolder , "--mapfiles" , self .nonExistingPath , "--dir" , self .cmdLineTestOutputFolder ])
164+ Emma . emma .main (args )
165165 self .assertEqual (context .exception .code , - 10 )
166166
167167 def test_noDirOption (self ):
168168 """
169169 Check run without a --dir parameter
170170 """
171171 try :
172- args = emma .parseArgs (["--project" , self .cmdLineTestProjectFolder , "--mapfiles" , self .cmdLineTestProjectMapfilesFolder ])
173- emma .main (args )
172+ args = Emma . emma .parseArgs (["--project" , self .cmdLineTestProjectFolder , "--mapfiles" , self .cmdLineTestProjectMapfilesFolder ])
173+ Emma . emma .main (args )
174174 except Exception as e : # pylint: disable=broad-except
175175 # Rationale: The purpose here is to catch any exception.
176176 self .fail ("Unexpected exception: " + str (e ))
@@ -198,18 +198,18 @@ def runEmma(self, outputFolder=None):
198198 :return: None
199199 """
200200 if outputFolder is not None :
201- args = emma .parseArgs (["--project" , self .cmdLineTestProjectFolder , "--mapfiles" , self .cmdLineTestProjectMapfilesFolder , "--dir" , outputFolder , "--noprompt" ])
201+ args = Emma . emma .parseArgs (["--project" , self .cmdLineTestProjectFolder , "--mapfiles" , self .cmdLineTestProjectMapfilesFolder , "--dir" , outputFolder , "--noprompt" ])
202202 else :
203- args = emma .parseArgs (["--project" , self .cmdLineTestProjectFolder , "--mapfiles" , self .cmdLineTestProjectMapfilesFolder , "--noprompt" ])
204- emma .main (args )
203+ args = Emma . emma .parseArgs (["--project" , self .cmdLineTestProjectFolder , "--mapfiles" , self .cmdLineTestProjectMapfilesFolder , "--noprompt" ])
204+ Emma . emma .main (args )
205205
206206 def test_normalRun (self ):
207207 """
208208 Check that an ordinary run is successful
209209 """
210210 try :
211- argsEmmaVis = emma_vis .parseArgs (["--project" , self .cmdLineTestProjectFolder , "--overview" , "--inOutDir" , self .cmdLineTestOutputFolder , "--noprompt" , "--quiet" ])
212- emma_vis .main (argsEmmaVis )
211+ argsEmmaVis = Emma . emma_vis .parseArgs (["--project" , self .cmdLineTestProjectFolder , "--overview" , "--inOutDir" , self .cmdLineTestOutputFolder , "--noprompt" , "--quiet" ])
212+ Emma . emma_vis .main (argsEmmaVis )
213213 except Exception as e : # pylint: disable=broad-except
214214 # Rationale: The purpose here is to catch any exception.
215215 self .fail ("Unexpected exception: " + str (e ))
@@ -219,35 +219,35 @@ def test_help(self):
219219 Check that `--help` does not raise an exception but exits with SystemExit(0)
220220 """
221221 with self .assertRaises (SystemExit ) as context :
222- args = emma_vis .parseArgs (["--help" ])
223- emma_vis .main (args )
222+ args = Emma . emma_vis .parseArgs (["--help" ])
223+ Emma . emma_vis .main (args )
224224 self .assertEqual (context .exception .code , 0 )
225225
226226 def test_unrecognisedArgs (self ):
227227 """
228228 Check that an unexpected argument does raise an exception
229229 """
230230 with self .assertRaises (SystemExit ) as context :
231- args = emma_vis .parseArgs (["--project" , self .cmdLineTestProjectFolder , "overview" , "--dir" , self .cmdLineTestOutputFolder , "--blahhhhhh" , "--noprompt" , "--quiet" ])
232- emma_vis .main (args )
231+ args = Emma . emma_vis .parseArgs (["--project" , self .cmdLineTestProjectFolder , "overview" , "--dir" , self .cmdLineTestOutputFolder , "--blahhhhhh" , "--noprompt" , "--quiet" ])
232+ Emma . emma_vis .main (args )
233233 self .assertEqual (context .exception .code , 2 )
234234
235235 def test_noProjDir (self ):
236236 """
237237 Check run with non-existing project folder
238238 """
239239 with self .assertRaises (SystemExit ) as context :
240- args = emma_vis .parseArgs (["--project" , self .nonExistingPath , "--overview" , "--inOutDir" , self .cmdLineTestOutputFolder , "--noprompt" , "--quiet" ])
241- emma_vis .main (args )
240+ args = Emma . emma_vis .parseArgs (["--project" , self .nonExistingPath , "--overview" , "--inOutDir" , self .cmdLineTestOutputFolder , "--noprompt" , "--quiet" ])
241+ Emma . emma_vis .main (args )
242242 self .assertEqual (context .exception .code , - 10 )
243243
244244 def test_noMemStats (self ):
245245 """
246246 Check run with non-existing memStats folder
247247 """
248248 with self .assertRaises (SystemExit ) as context :
249- args = emma_vis .parseArgs (["--project" , self .cmdLineTestProjectFolder , "--overview" , "--inOutDir" , self .nonExistingPath , "--noprompt" , "--quiet" ])
250- emma_vis .main (args )
249+ args = Emma . emma_vis .parseArgs (["--project" , self .cmdLineTestProjectFolder , "--overview" , "--inOutDir" , self .nonExistingPath , "--noprompt" , "--quiet" ])
250+ Emma . emma_vis .main (args )
251251 self .assertEqual (context .exception .code , - 10 )
252252
253253 def test_noDirOption (self ):
@@ -258,8 +258,8 @@ def test_noDirOption(self):
258258 # This a is a specific case, the default Emma results will not work here. Because of this, we will delete it and run the Emma again.
259259 shutil .rmtree (self .cmdLineTestOutputFolder )
260260 self .runEmma ()
261- args = emma_vis .parseArgs (["--project" , self .cmdLineTestProjectFolder , "--overview" , "--noprompt" , "--quiet" ])
262- emma_vis .main (args )
261+ args = Emma . emma_vis .parseArgs (["--project" , self .cmdLineTestProjectFolder , "--overview" , "--noprompt" , "--quiet" ])
262+ Emma . emma_vis .main (args )
263263 plt .close ('all' )
264264 except Exception as e : # pylint: disable=broad-except
265265 # Rationale: The purpose here is to catch any exception.
0 commit comments